Just some algorithmic thinking is all. Basically it keeps comparing the first element to every element in the vector one at a time to make sure they are the same as the first element, (thus, they would all be the same). If it finds an element that doesn't match, it will return false, but if it makes it all the way through the for loop without returning false, it must be true, so there's a return true statement at the end.