The phrase means there is a logical, purposeful strategy behind behavior that appears irrational, chaotic, or insane.
From Shakespeare's Hamlet (Act 2, Scene 2). Polonius, observing Hamlet's bizarre antics (feigned madness), says:
"Though this be madness, yet there is method in't."
Hamlet's "madness" is a calculated performance to investigate his father's murder without alerting Claudius.
It validates non-linear thinking: what looks like disorder may be a higher-order pattern.