This extended meaning refers to edges that project outward or surround an opening.
The jar has two narrow lips around its opening.
Waves broke over the rocky lips of the cave.
This figurative use refers to spoken words, especially disrespectful talk or something being said aloud.
Do not give me any lip.
The secret never passed his lips.