When an object moves in a circle, which is effectively what a roller coaster does when it travels through a loop, the moving object is forced inward toward what's called the center of rotation. It's this push toward the center -- centripetal force -- that keeps an object moving along a curved path.
Centripetal force prevents moving objects from exiting a curve by continuously making them change their direction toward the center of rotation. For a roller coaster, gravity pulls down on the cars and its riders with a constant force, whether they move uphill, downhill, or through a loop. The rigid steel tracks, together with gravity, provide the centripetal force needed to keep the cars on the arching path as they move through the loop.
In the "gravity-defying" cup-of-water demonstrations featured in this video segment, the push from a board against a cup makes the cup continuously change direction and keep moving in a circle. What provides the push in this instance? It's the tension in the strings attached to the board, together with gravity.
Gravity always pulls downward with the same strength, and, in the case of a roller coaster, it pulls downward on the cars wherever they are on the track. Near the bottom of a loop, gravity pulls in a direction away from the center of the loop circle. Here, the centripetal force is the difference between the force of the track pushing up and gravity pulling down. Near the top of the loop, however, gravity and the track both act with a downward force and work together to provide the centripetal force; their forces add together. Regardless of where the cars are in the loop, centripetal force is always directed toward the center of rotation. So even if a car you're riding in is at the top of a loop, upside-down, you will feel yourself pressed into your seat.
Often, people confuse centripetal force with centrifugal force. The sensation roller coaster riders experience that makes them feel like they're being pushed into their seats as they go through a loop is commonly referred to as centrifugal force, although it isn't a force at all. It's the result of observing one's motion relative to the object in which one is traveling.
To better understand the distinction, put yourself in the rider's place. When the roller coaster car you're riding in changes direction, your body continues to travel in the same direction it was traveling in before the change in direction. (If the car and track weren't there, you would continue on this path.) As a result, you find yourself pressed against the seat throughout the loop -- perhaps most surprisingly at the top, when you're completely upside-down! If you were to observe your motion relative to the car, however, you'd realize that the seat is actually pushing down on you, inward toward the center of rotation.