The observation leading to this phrase was first made by the character of Dr. Horrible/Billy (Neil Patrick Harris) in "Dr. Horrible's Sing-Along Blog" in reference to Captain Hammer (Nathan Fillion), as shown below.
Billy: Trust your instincts.
Penny: But, he turned out to be totally sweet. Sometimes people are layered like that. There's something totally different underneath than what's on the surface.
Billy: And sometimes there's a third, even deeper level, and that one is the same as the top surface one.
Billy: Like with pie.
Woman with black eye: I know my new boyfriend might seem like a drunken, misogynistic ball of domestic violence waiting to happen, but he's actually really nice, he's layered like that. And now he's promised to only beat me on Wednesdays!
Friend: Yeah, layered like pie. Call the cops on him!