Balance is what keeps you on the horse, not leg strength or gripping.
Try this: at the walk, take a deep breath in, then breath out, allow your shoulders to drop, lean backwards, slump in your saddle, then allow your head to bobble with the movement of the horse. (like those bobble dolls you see in the back of car windows, Bobbleheads, they call them.)
Did you notice a change in your horse's walk? Did it slow down or stop?
Essentially, you dropped your weight from your shoulders to your butt in the saddle, securing your balance and also indicating to your horse to slow down or stop.
Ok, now if the horse stopped, you'll have to apply leg and ask for it to go forward again. Stay relaxed as above, creating energy with your legs with a squeeze/release asking the horse to walk. Now ask for the trot, only a few strides at a time. Bobble your head, it will help you find the rhythm of the trot. The second you feel unbalanced and want to grip, come back to walk. Keep repeating the walk/trot, walk/trot, procedure staying relaxed. As you gain confidence and balance, see if you can trot a couple more strides extra. Keep adding more strides, and pretty soon, you may make it all the way around the arena one time. Do not try circles or turns until you can sit the trot comfortably on the rail. This might be done in one session or it may take you several sessions to master it.
You must lean back to catch the foreward motion of the trot. If you are already foreward, the trot will throw you foreward more and then you'll want to grip to catch yourself. Then it will all fall apart.
Lean back further than you think you need to. It may feel awkward at first, but you will find it easier to catch the rhythm. Bobbling your head is just an exercise to help you find that rhythm.
Many people have to force their head to bobble because they are so tight in their shoulders and neck. Some people it comes to them naturally. If you are one that has to force the head bobble, try tucking your chin to your chest for a few seconds, then allow it to release and bobble with the motion of the horse. Others have to nearly look at the ceiling or roof of the arena for several moments and then release it and can then bobble their heads.
Some people think of it as a head nodding. Nodding their head quickly as if to say yes to something. The faster the horse walks or trots, the faster your head will nod or bobble.
Practice it at walk, try at trot a few strides. Keep doing it and you'll eventually figure it out. DO NOT GRIP, it will "pop" you out of the saddle and you'll lose your balance.
Good luck, hope this helps.