An onlooker is someone who watches something but isn't directly involved in it. The spectators at a boxing match or a dog show or a marathon are all onlookers.
If you observe an event but you don't participate in it, you're an onlooker. The event itself might be a performance of some kind, like a concert or a football match, or it might be some undesirable occurrence: "The firefighters battled the blaze while onlookers watched in horror." Onlooker dates from the early seventeenth century, from the sense of "looking on."