The lexer groups individual characters into building blocks, tokens, that the language is made of. From keywords such as "if", "for", "function" and symbols like "{", to arbitrary identifiers that doesn't contribute to the actual meaning or structure of the program, i.e. "foo".
The parser groups the tokens into meaningful statements, it implements the grammar. If the parser sees an "if", it expects some condition next (depending on the grammar of course). If the parser detects statements that are not consistent with the grammar of the language, it should reject the program.
Tldr they work on different levels, lexers just finds the individual building blocks, the parser builds the program