As a U.S. citizen I can choose to live in all fifty states and U.S. territories, but confound it, I discovered other countries set immigration rules that serve THEIR interests and needs.
You need to have a TM 30, Notification from House-Master, Owner or the Possessor of the Residence where Alien has Stayed, on file with immigration for your girlfriend’s residence when you stay there.
A re-entry permit allows you buy a permit to maintain your long-term visa status, which you have already paid for, by purchasing a permit that allows you to travel out of Thailand temporarily and return without losing your legal status on the long-term visa which you already paid for.
It’s a “Hey, I am coming back, so don’t invalidate my visa because I have left.”