CYA Disclaimer: The following is intended for reference purposes only and not as legal advice.
What is trespassing, anyway? Most of us think we know. But the more you think about it, the more complex it can get. For example, could you be sued for trespassing on property that you are the owner of? Of course you could! If you rent it to someone else, you might have only a limited right to enter the property (for inspection or repairs, for example). If you enter the property for any other reason (or without proper notice) you might find yourself being told Yew git off your property! The point is that the concept of trespassing protects possession, and not necessarily ownership.
Another unique point of trespassing law is that liability is absolute. If you take an umbrella from a restaurant when you leave believing it is yours (because it looks just like yours), you have not legally stolen anything even if the umbrella belongs to someone else, as long as you can established that you reasonably believed it was yours. On the other hand, if you build a shed on land that you believe is yours (because the map given to you by the local land office indicates that it is yours), you are a trespasser even though there’s no way you could have known that the land wasn’t yours (there are hidden complexities to this which are beyond the scope of this article). Note that the amount of damages might be less if your trespassing was unintentional. They may even be nominal (e.g. one dollar) if your trespassing did no harm. On the other hand, a non-volitional intrusion is not trespass if you tripped over a stone and fell into your neighbor’s yard, for instance.
You are also not trespassing if you have a legitimate invitation and invitations can be implied rather than actual. That is why you can’t sue your mail carrier for walking across your yard to deliver your mail without permission.