So this is more of a PHP question than a Craft question, but the only example I can offer is one I've seen in Craft.
{{ craft.entries.id(4).one() }}
Returns a simple string like: "About Page"
{{ dump(craft.entries.id(4).one()) }}
Returns the entire element object.
From a PHP perspective, how does this work? Or where can I find out more about this practice?
It's a tricky thing to look up online and tracing through Craft's codebase hasn't offered much insight for a novice like me.