There are multiple reasons why an athlete might experience cramping
1. Dehydration- This one is obvious. If an athlete does not properly hydrate themselves before competition then he or she can experience muscle cramping. An athlete needs to be hydrated throughout the week.
2. Over-hydration- It is actually possible to over-hydrate. A lot of athletes think if they just drink a massive amount of water the night before game day and on game day that they will be fine. You can actually flood the muscles with too much water and dilute your electrolytes.
3. Heat- this ties into to hydration. The more you sweat, the more essential nutrients you lose. Things like sodium/potassium/magnesium. (Electrolytes)
4. Anxiety/Nervousness- Anyone who plays sports or has a pulse has felt butterflies and has been nervous before competing. It is natural but it does cause your body to react in a certain way. Your heart rate might raise, you start to sweat, become restless, and breathing can change. This is because of adrenaline and the fight or flight response. Some athletes can deal with their emotions better and stay calm.
5. Excited/Amped up- Related to adrenaline and fight or flight. Your body responds by giving you that energy boost you need but this comes at a cost.
All of these things occur before a player even sees live game action. Depending on how the athlete prepared themselves and how they deal with stress can impact whether or not they cramp up.
Now think about static stretching before games and warming up. A player gets loosened up and breaks a sweat an hour before the game starts. Goes back into the locker room where their bodies cool down and now the coach has them turn the lights off and sit still for a 10 minute pregame speech intended to pump the kids up. Everyone is up - hooting and hollering now they run onto the field with the crowd screaming. It's time for kick-off. No time to get warmed back up.