When energized with electric current, electromagnets create a magnetic field that attracts certain metals that contain iron, like steel. (For more information on how this happens refer to the Solenoids, relays and electromagnetism lesson.) The magnetic field exerts a force on steel similar to the gravitational force that the earth exerts on all of us.
The force of gravity is what causes things to fall to the ground when they're not otherwise supported. As things drop and fall to the ground, they don't fall at a constant speed. They actually accelerate and fall with higher and higher speeds until either they hit the ground, or until the force of friction with the air is equal but opposite to the force of gravity. An apple that falls from a tree will most likely accelerate until it hits the ground; the air will have little effect on its speed. A falling feather on the other hand accelerates to a certain speed, but then continues with a relatively constant speed because it has enough friction with the air to prevent it from traveling any faster. The air friction in this case eventually exerts as much force on the feather as gravity does, but in the opposite direction.
The general rule, known as Newton's second law of motion, is that objects that have a net force on them accelerate. The complimentary rule, known as Newton's first law of motion, says that if there is no net force there is no acceleration and the object remains at the same speed (or at rest if its speed is zero).
When electromagnets attract steel objects the magnetic force causes those objects to accelerate too, rather than travel at a constant speed. Solenoid plungers and relay armatures accelerate over a short distance before they reach the limit of their motion where they stop immediately - like a falling apple hitting the ground. It's hard to see how they move before they stop. The steel ball in the electromagnet display moves more slowly and has more room to move around so it's easier to see the effects of the magnetic field and acceleration on the ball.
The electromagnet is just a coil of wire like a solenoid or relay. When it is activated with electric current, the force of the generated magnetic field draws the steel ball towards the center of the electromagnet from where ever it is. The ball accelerates towards the center because of the magnetic force. But what happens to the ball once it passes the center of the electromagnet?
Imagine the behavior of a ball attached to an elastic cord, like the rubber ball on a paddle ball. When the ball is at the end of the stretched out rubber band, the force of the rubber band pulls it towards the paddle. If the ball misses the paddle and passes by it, the rubber band starts to stretch out in the opposite direction. As the rubber band stretches out, the ball slows down and eventually changes direction and heads back towards the paddle.
The ball in the electromagnet display behaves the same way. When the ball is off to one side, the activated electromagnet pulls it in towards the center. The ball accelerates towards the center because there is a magnetic force acting on it. Once the ball passes the center of the electromagnet, the magnetic force pulls it in the opposite direction (back towards the center which is behind it), just like the ball on the paddle ball. The ball in the electromagnet display slows down, changes direction and accelerates back towards the center of the electromagnet.
As long as the electromagnet remains energized, the process repeats, and the ball passes back and forth over the center of the magnet. Each time the ball overshoots the center just a little bit less than the previous time because rolling friction gradually reduces the maximum speed of the ball until it eventually comes to rest at the center of the electromagnet.
The previous section describes why the ball eventually comes to rest at the center of the electromagnet if the electromagnet stays energized. Is there a way to keep the ball moving, or to make it go faster? As mentioned earlier, the ball starts to slow down just as it passes the center of the electromagnet. What if the electromagnet were to shut off before the ball starts to slow down?
If the electromagnet shuts off just as the ball reaches the center, the ball won't slow down after it passes the center because there won't be a magnetic force on it in the opposite direction. (There will still be friction to slow it down, but its force will be very small in comparison to the magnetic force.) The ball will careen towards the edge and bounce off a rubber ring moving much faster than it would have if the electromagnet had stayed energized. If the electromagnet is re-energized as the ball heads back towards it from the rubber ring, the magnetic force will accelerate the ball and make it go even faster.
With just the right timing, the electromagnet can be turned on when the ball is headed for it's center, and turned off when the ball is heading away from it. In this case the ball will only accelerate due to the magnetic force (and never decelerate because of it) and can be made to go very fast indeed. It's interesting how using less electric energy can actually end up making the ball go faster.
Watch the video of the electromagnet below and watch how the behavior of the ball changes depending on whether the electromagnet is on constantly or intermittently.
Find more background information about other pinball machine devices is on the Things to Learn page.