No, $...$ doesn't simply change the encoding.
Inside a math formula, inline or display, the interpretation of character tokens changes radically.
In text mode, a character is considered a pair “character code/category code”. Characters with category code 11 or 12 are simply printed; the difference is mainly for the purpose of hyphenation: a candidate word for hyphenation only consists of category code 11 characters (letters); thus punctuation doesn't hinder the process, because punctuation characters have category code 12.
In math mode, characters with category code 11 or 12 are examined in a different way: each character has an associated math code, which is a 15-bit integer, most conveniently shown in four hexadecimal digits. For instance, the math code of a is "7195, whereas the math code of ( and ) are, respectively, "4028 and "5029.
What does this mean? Briefly, the most significant byte declares the type of the object, the next byte states the (default) math family it belongs to, the last two bytes denote a slot in a font. Type "4 means “opening”, type "5 means “closing”. Type "7 is special, but basically denotes an “ordinary” atom.
The type is important for adding automatic spacing between atoms.
In order to being able to typeset formulas, TeX needs four math families, numbered 0, 1, 2 and 3. Each family consists of three fonts, for the different levels (normal, first and second level sub/superscripts). Family 0 usually points to (different sizes of) the text font; family 1 contains math letters (Latin and Greek, plus some symbols); family 2 contains symbols; family 3 contains large symbols (summation, integral) and extensible fences.
Due to practical limitations of the time when TeX was developed, fonts were limited to 128 slots and math families to 16. This forced Knuth to fill the available slots in ways that are not always consistent. This is a font table for a typical family 1 font

It mostly contains letters, but also some symbols and also “old style digits” that aren't properly math, but Knuth didn't want to leave slots free. A typical font for family 2 is laid out as

Mostly symbols, but also the uppercase calligraphic letters. The last row has miscellaneous symbols that aren't properly math.
Now, what's an output encoding? For instance OT1, T1 or OML?
A problem raised by internationalization of TeX was that in the standard fonts letters with diacritics had to be produced with the help of the \accent primitive, which has the defect of inhibiting correct hyphenation of words past accented letters. Not a big problem for Italian, where the diacritics are only used on the last letter; a humongous problem for German, French, Hungarian, Czech and so on, where diacritics can and do appear very early in the words.
At the TUG 1990 conference in Cork, Ireland, a new font layout was agreed upon, which contained slots for accented letters providing support for most (not all) European languages using the Latin alphabet.

Notable exceptions are Lithuanian, Latvian, Estonian, Romanian and Maltese that need diacritics not in the font table. But, hey, fonts could only contain 256 characters! Unicode was still wearing diapers, at the time!
At the same time, Frank Mittelbach and Rainer Schöpf were working on the project of porting AMS-TeX to LaTeX and realized the need for a completely different font selection scheme for LaTeX. This is where the concept of output encoding was born. Actually, the first version of the New Font Selection Scheme (NFSS1) didn't have the concept, which was added in NFSS2, which is currently used (with changes) in LaTeX.
Each font is characterized in NFSS2 by four independent axes
- encoding;
- family (typeface);
- weight (or series), for medium, bold, thin, extrabold and so on;
- shape, for upright, italic, slanted and so on.
With a very clever method, sequences such as \'e or \`A can be dealt with differently according to the current font encoding. For instance, in OT1 they resolve to the “Knuthian accent over letter” method, in T1 they resolve to \char"E9 and \char"C0.
Side note. When you type é or À, LaTeX translates the raw internal code (one or more bytes) according to the current input encoding into \'e and \`A, respectively.
The math (output) encodings OML, OMS and OMX are never used as such for output, because of the special treatment of characters and commands in math mode. They exist for the purpose of loading fonts using NFSS2 and assigning them to math families. They also provide a framework for defining math fonts, so that they can use a “standard” association of math codes. Some math fonts comply, other use altogether different assignment of characters to slots in the font.