Why wasn't my iPhone going to the home screen?

Before someone says it's probably frozen, it isn't. I was on the third page and I'd try to swipe to either my second or even the home screen, and it would go there but then immediately slide all the way back to the third page. I'd press the home button and it would do the same thing.
I did manage to restart my phone and then it was fine after, but I'd still like answers because I'm concerned that my phone has been hacked. There's a situation going on with someone who is capable of doing something like this, and I've noticed my battery has been draining faster than it ever has.

If anyone has any idea what was going on, let me know please.

It wasn't hacked. It just one of those many weird things that get "magically" fixed by restarting your device. No problem.

If you updated to iOS 11, I've noticed the battery drains faster now… Both iPhone and iPad.