The record and the ground disagree more often than people expect. A deed describes land in words, by reference to a recorded plat, to a government survey grid, or by metes and bounds. Those descriptions were written by people, sometimes a century ago, and the physical world has since acquired fences built by eye, driveways poured to a convenient line, sheds placed where there was room, and hedges that moved. The survey is what reconciles the two, and the discrepancies it finds are the reason it exists: a garage three feet over the line, a driveway that crosses the neighboring lot, a boundary the seller has always described one way and the plat describes another.
Surveying is licensed, and the license comes with public duties. Under California's statute, a licensed land surveyor or civil engineer who makes a field survey must file a record of that survey with the county surveyor where the survey discloses, among other things, "[a] material discrepancy with the information contained in any subdivision map, official map, or record of survey previously recorded", or points and lines set during the survey of a parcel described in a recorded deed that appear on no existing map. The filing deadline is 90 days from setting the monuments or completing the survey, whichever comes first, and the record goes to the county recorder after examination. The practical consequence is that a survey which finds a real conflict in one of these states does not stay a private document; it becomes part of the public record other surveyors will retrace later.
Different products answer different questions. A survey establishing where the lines run and where improvements sit relative to them is what a residential buyer usually means. A topographic survey maps elevations and contours. A subdivision survey divides a tract into lots. An elevation determination is a separate exercise again, and federal flood-map procedure contemplates exactly that: a property owner asking FEMA to correct a mapped designation may submit "[a] certification by a Registered Professional Engineer or Licensed Land Surveyor that the lowest grade adjacent to the structure is above the base flood elevation". Ordering the wrong product and expecting it to answer a boundary question is a common and expensive mistake.
Whether anyone will order one is a matter of practice, not of law. Whether a survey is customary on an ordinary residential purchase is a question of local practice, and the lender's own position varies by loan program, by investor and by state. A buyer who wants to know where the boundary is generally has to ask for the survey and pay for it, and the moment to do that is inside whatever inspection or due-diligence period the contract gives, because a discrepancy found afterwards is a negotiation the buyer enters from the weaker side.
What the survey finds, and who owns the problem then, are separate questions. A surveyor reports where things are. Whether a structure that crosses a line has to move, can stay by agreement, is covered by an existing easement, or has already ripened into someone else's ownership are legal questions decided under the law of the state where the land sits, and they are answered by the title work, the parties, or a court rather than by the survey drawing.