When you purchase a property, you own it in two ways: As it is described in your deed, and what you occupy on the ground. Hopefully they match. When they match you have "perfect" marketable, insurable title. When they don't match, unpleasant and possibly costly consequences may arise.
A surveyor uses precise instruments and measuring techniques to find your parcel on the ground based on the physical monuments described in your deed. The surveyor uses that same precision to map the physical features and uses of your property in relation to the deed lines, and will show any discrepancies between deed and occupation on the map.
When there are no discrepancies between deed and occupation, the situation is called "droit-droit" defined in Black's Online Law Dictionary as "A double right; that is, the right of possession and the right of property. These two rights were, by the theory of our ancient law, distinct; and the above phrase was used to indicate the concurrence of both in one person, which concurrence was necessary to constitute a complete title to land."
When there are discrepancies between title and occupation, some people choose to amicably create and record a boundary line agreement with their neighbor, perhaps buying or selling a narrow strip of property to adjust the lines to match occupation. Some people use the court system to defend their deed against adverse possession or to "quiet the title" on their long-term occupation.