Beginner needing help

From the query example explained the above picture.

select userid, salary from salaries where userid = 'jsmith' OR '1' = '1'

My question is when we are using OR '1'='1' as a malicious code, why do we even mention 'jsmith' in the first place? why is this needed is what im asking. Is it because the query needs a response it identifies first so that it can then after vomit out all the information because of the 1=1 statement?

Hope i don't sound dumb, new to all of this type of stuff!

You can filter your results with WHERE. So when you search for 'jsmith' you will only get results for jsmith. But when a user creates a username like jsmith' OR 1=1 then the query becomes

WHERE userid = 'jsmith' OR '1' = '1'

'1'='1' is always true so it will return all data of all users.