1. Guys get erections because they get sexually aroused but a lot of the time a guys body can get sexually aroused without the guy really being aroused. Eg a guy can get an erection just from a girl holding their hand on sitting on their lap or even smiling.
2. The second way guys can get erections is because the body has to circulate more blood around the penis every so often for cell regeneration etc. Sometimes people call them "random boners". You get a lot of these during puberty especially when you've just "dropped your balls" (Penis triples or more in size in what seems like a day but is probably a year or so).
There are several ways guys can hide erection. This video
shows various ways that are all the tried and tested ways with a funny slant.
Guys get them all the time because they're not always because they're horny. And absolutely any sexual thoughts (which we have lots of) can set it off.
You'll know if someone has an erection because you'll feel a big hard lump of flesh in an area where you were sure there were no limbs.