They are half random but are more likely to show up based on the following conditions.How are shields supposed to work?
Also, how do summons work? The prompt for Ramuh seems completely random, and it's just a one hit kill move for the most part.
Ramuh shows up the longer the battle goes on.
Titan shows up the longer your team mates are in danger zone but he cannot be summoned in dungeons and indoor areas,
Leviathan shows up the longer Noctis is in the danger zone but you need to be near a large body of water.
Shiva is a combination of the above three.
As you can see, Ramuh is the one that is most likely to appear since you want your team and yourself to be out of the danger zone ASAP.