There are multiple types of ammeters, and each one works slightly differently. For example, a moving coil ammeter uses magnetic deflection to allow for the movement of the coil in a magnetic field, which allows the user to measure the electric current in a circuit. A moving iron ammeter uses a fixed coil, rather than a moving coil, as well as a moving piece of iron that allows the user to measure the electric current.
Hans Christian Orsted first discovered the effects of a magnet on a compass. He found that when an electric current was flowing near the compass, its needle would be deflected from pointing north. This original tool that the ammeter was developed from, a multiplier, was used to measure currents. However, it worked only when it was aligned with Earth's natural magnetic field. This was not practical in modern times for measuring electric currents, so an ammeter, which relies on an electromagnetic current running perpendicularly through a conductor, is used today to measure electric currents in a circuit.
The ammeter earned its name because the unit of measure in which the electric currents are measured are called amps. A perfect ammeter has zero resistance within the structure, but most ammeters have a minimal and usually trivial amount of resistance that can affect the reading of amps in a current.