From time to time neighbors discover that a fence between their properties is not located on the true property line.
California allows a fence to establish the property boundary if the true boundary is not known (imagine a twisting property line following a no longer existing road) and if the adjacent landowners agree to the property line.
For most urban and suburban properties a survey can determine where the property boundaries are. Thus the true boundary is known even though the property owners may not know. The fence does not establish the property boundary.
Problems still arise because the courts have allowed encroaching neighbors limited rights to what is actually their neighbors property.
A short discussion of the limited rights granted to a neighbor is at: http://julianalee.com/reinfo/property-ownership.htm