The sequencer can be the timing master and be used to synchronize other sequencers, or it can be a timing slave and thus has to synchronize to another time source. These two types are completely different and can even be used concurrently. The sequencer can be used as slave to synchronize to another master. To get higher resolution, any timer within the system can be used. This can be used as master clock for the sequencer.
Audio playback can also act as a time source for synchronization.
By using a counter of the number of samples played for syncing the master clock, it's a good starting point to get MIDI in sync with digital audio. MIDI clock can also be used as time source for the sequencer. This port can also play it's role in the synchronization game. External switch, eg. connected to a bass drum pedal to sync sequencer to a band. In cast the sequencer has to sync to another source, it will keep using it's own local timer for determining schedule time of events.