How do I get unlock my Samsung Galaxy s7

A

AC Question

This morning I was texting a friend and when I went to respond my phone told me my password was inccorrect. I was just on my phone, no one was around me to change it, and I know what my password is because it is the same as my iPad password and I can get into that just fine. I thought that maybe I was just typing it in wrong. I then tried again and again with no luck. Now I am locked out for an hour. Why did this happen and can my phone somehow change my password without my knowledge?