Each tree is built from a small set of rewrite rules (simplified X-bar / phrase-structure grammar):
S → NP VP
NP → (Det) N (PP)
NP → Pro
VP → V (NP) (PP)
PP → P NP
"I saw the man with the telescope" is structurally ambiguous: the PP "with the telescope" can attach either under VP (I used the telescope to see) or inside the object NP (the man had the telescope). Same words, two trees, two meanings.