Shat is the past tense of Shit which is the present tense of crap, so, i shat my pants is saying i shit my pants, which means i crapped my pants, which means i took a poop in my pants, which means I dumped a lump
I shat myself is an even more extraordinary sentence for I shit my pants, you don’t want to go around saying “I shit my pants” but instead you could say “ I shat myself” you’ll be the coolest kid at school.