The plot is the story line or sequence of events in a book, film or play. If you lose the plot, you lose track of it and you can’t follow it.
As an idiom it is a metaphor, usually for someone who has lost touch with reality.
Here’s a sixties icon who lost the plot big time, Syd Barrett, founder member of Pink Floyd, in a rare interview.
After a summer of continuous LSD use, he’d shattered his fragile mind until only an empty shell remained. Sadly, he lost the plot, never to regain it.