You probably want a bit of randomness in your game, for example when enemies shoot a bullet or how long an explosion lasts. However sometimes you want it to be the same every game, so the player will know that an enemy will enter the stage and always shoot a bullet. You want some randomness, but consistent randomness so it is the same every time.
"When replaying levels, enemies always appear in the same location and follow the same behavioral patterns"
One way to do this is to have an array and load this with pre-calculated random numbers. When your game needs a number, call the next one off the stack and loop back to the top when you have run out.
One cool thing you can do with this is save a replay. If you capture the player's inputs each tick, then in theory everything in the game should play out the same way. You could use this for demo mode or as a save feature.