As a property owner, you have a duty to provide a safe environment for people who enter your property. This is an area of law known as premises liability. When certain categories of people (invitees or licensees) enter your property, if you're aware--or should be aware--of potential hazards on the property, you have a responsibility to warn the visitor of the danger and/or try to remove the hazard. This rule would apply to a customer in your store or an invited guest in your home, for example.
When someone trespasses on your property, you may not expect to be responsible for their safety--after all, they're intruding on your land without your permission. Additionally, since you don't typically anticipate having home intruder, you shouldn't be expected to warn them about potential dangers. These expectations holds true in many cases. However, there are some exceptions.
If you can reasonably expect to have trespassers on your property, then you have a responsibility to warn them about potential dangers. To be clear, this rule does not imply that if, for example, you get burglarized multiple times over a short span of time, you are now obligated to start leaving notes for the home intruder, warning them about the uneven floorboard in your kitchen. Here's an example of how this rule is actually applied:
Let's say you live near a public beach. In the summer, you know that beach-goers regularly cut through your backyard to access the waterfront. You're fine with this arrangement. However, this year you've taken up a new archery hobby--and you do target practice in your backyard. Since you know that trespassers access your backyard with some regularity, you have an obligation to post signs to warn them about the safety hazard.
Attractive nuisance: child trespassersIf you have something on your property that is accessible and attractive to children--and could also be a danger to children--then you could be held liable if a child enters your property and gets injured using it. If you have an in-ground swimming pool in your backyard, for example, and you do not provide a warning against using it, then you could be liable if a trespassing child enters the pool and gets injured.