What you are calling a "spy earpiece" is nothing more than a regular hearing aid in which the microphone has been replaced with a coil.
A simple hearing aid has a microphone, a small amplifier, a single button cell, and a small speaker. The button cell provides power to the amplifier. The amplifier takes the signal from the microphone and drives the speaker.
Such a simple circuit might look like this:

Source
Replace the microphone in that circuit with a coil and you've got your "spy earpiece."
In a modern, good hearing aid, the op-amps are replaced by a specially designed IC that includes a digital signal processor and some stuff that allows it to be programmed from outside - the one IC handles amplification, automatic gain control, equalization (it can amplify specified frequency ranges to compensate for the loss of hearing in specific ranges,) and communication with the programming system.
The "transmitter" for such "spy earpieces" is also a simple coil, though much larger. It is usually driven by the earphone output of a hidden radio. The transmitter coil may be in a small box hidden under the clothing, or it may be around the neck disguised as a necklace or other jewelry or decoration.