When a frame arrives, the switch reads the source MAC. If that MAC isn't in the table, it adds an entry: this MAC is on this port. If the MAC exists on a different port, the switch updates the entry. Each entry has an aging timer, typically seconds. If no frames arrive from that MAC before timeout, the entry is deleted. This keeps the table current.
##### ###### ##### ### # # ### # # ###### ## ## ## ## ## ## ## # # # # # ## ##### #### ##### # # # # # # # #### ## # ## ## ## ## # # # # # ## ## # ###### ## ### # ### # ######
$ curl repovive.com/roadmaps/network-design/physical-and-data-link-fundamentals/mac-learning-process
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░████████████████████████████████████████████████████████████████████████████████████████████████████