No, they don't:
transit
Passing through a place briefly while travelling on the way to somewhere else.
layovers
The period of time spent waiting for a connection (unlike stopover this is not chosen by the traveller).
For example, for transit
there is no mention of "connection", and for layovers
there is no mention of "briefly".
They are both related to travel, that is the nature of this site, and they both involve a hiatus so in some circumstances either would be equally applicable. Also, being of similar meaning they will at times be misused.
A layover is generally static (eg spent sat in an airport terminal). Transit generally involves motion, thus @phoog's example, as:
in the case of someone who wants to drive from Canada to Mexico.
Given we also have stop-overs:
Scheduled stop in the middle of a transit decided by the traveler.
and it is generally the traveller that chooses their route (from those available) the selection of 'layover' rather than 'stopover' may suggest a measure of inconvenience (say from the delay). Similarly, 'transit' tends to incorporate the interval into the journey as a whole, and since presumably that is willingly undertaken, is quite welcomed. Whereas 'layover', by emphasising the break in the journey, is not welcomed.