There is a sensor embedded in the pavement right behind that white line that is painted on the pavement at the stop light. This sensor lets the traffic signal computer know when a car is present so that it will trigger a light change.*
If you stop beyond the white line...no trigger and the light won't change. You can be rescued from the effects of your dumbassery by the driver behind you, who stops behind you and therefore behind the white line.
However, if you stop a car length behind the white line (and seriously, whodahell told you to do that???) once again, no trigger and SURPRISE! the light won't change, but this time no one can save you from your dumbassery. This is why you are still sitting there after three cycles of the light. You, and everyone behind you, will sit there until you finally extract your cranium and pull up to the white line.
The drivers behind you would like to show you their appreciation. This is why they are honking and waving at you.
*If you are on a motorcycle you aren't a dumbass, you just don't have enough metal to trigger the sensor. Try putting your kickstand down.