Most garage door openers work on a radio signal in 300-400MHz. There are various identification / code systems in use to uniquely pair transmitters and receivers.
My San Francisco garage works by having the transmitter and receiver share a single 10-12 bit key that is programmed via DIP switches. Presumably they also have to agree on which frequency they speak. (Two gate controllers also work via DIP switches.) Note this kind of system is terribly insecure, it’s easy to build a universal opener that just sends all codes.
My Grass Valley garage has Intellicode, a rolling code. This works by the transmitter having a secret key. You put your receiver in “learning mode” and it memorizes the secret key. Then there’s a simple PRNG-like crypto protocol where the transmitter is generating one time passwords that the receiver recognizes. This is more secure than a fixed code, although there are attacks against it too.
There’s a variety of “learning remotes” that you can use to duplicate a garage door opener, to make a new transmitter. Fancy cars tend to have HomeLink systems. I just bought a Clicker battery powered remote.
HomeLink seems to work by first listening to a working transmitter, then copying it. Presumably it’s figuring out what frequency to use. And if it’s a fixed code, it learns the 10-12 bit code that otherwise you’d set with DIP switches. If there’s a rolling code you have to do an extra step of having the receiver now learn the HomeLink’s key.
The Clicker seems to work by me manually identifying which type of transmitter I’m trying to clone. It’s got a library of ~15 types, which presumably tells it what frequency to use and what kind of code it needs. Then there’s either physical DIP switches to set and memorize or for a rolling code, you have the receiver learn the Clicker’s key.
There’s also a new modern world of Internet-enabled garage door openers where you just tell it to open via a smartphone app. I’m told you can retrofit these as new receiver units wired into an existing working motor drive unit.