There are several risks:
#1 – Your vulva and butt crack will be on full display (see photo above).
#2 – Any and all vaginal discharges will be secreted directly onto your leggings (yuck). As a result, you would have to wash your leggings frequently which will shorten their life span and potentially ruin their color – if not also their fit.
#3 – If you happen to have your period that day, blood all over you isn’t a particularly nice feeling.
#4 – Feminine odors are much more likely to be perceived by others if you go commando.

#5 – [Above] You may not realize how sheer your leggings are, but others surely will.

#6 – [Above] Is this a look you aspire to?
#7 – You can feel itchy down there if you wear leggings or yoga pants without wearing underwear.
All things considered, there are no upsides to not wearing underwear under leggings and several downsides. At the very least, wear a thong with a panty liner to avoid unnecessary embarrassment.