“Lie in bed” literally means to sleep; it means to lie under the covers between the top sheet and the bottom sheet. It is generally about the usual bed one sleeps in.
Example: All he does is to lie in bed all day. Doesn’t he get bored?
It’s possible to “lie on the bed,” too. This means that you are not in bed for the purpose of sleeping, but perhaps sitting on it to talk on the telephone.
“In bed” is one of those phrases in English that are somewhat set to mean other thonings (figurative). For instance, “in bed” can simply mean “asleep”. “In bed” however applies mostly to people/animate objects that sleep. If you had a book, and it was on the bed, you wouldn’t say the book was “in [the] bed”, but “on the bed” even if the book were under the covers.
Usually though for people, “in bed” means “inside the bedding-environment” (under the covers), and on the bed is on top of it.