If a child trespasses onto a property, lured by an abandoned car or swimming pool, say, then it is the property owner’s responsibility to remove the temptations and secure the area.

This is the law of the “attractive nuisance” — something that is dangerous and attractive to children who do not appreciate its danger.

In the same way, the United States has created an attractive nuisance for desperately poor people from Latin America and elsewhere.

After declining for years, illegal border crossings are sharply up at the moment.

Here the Trump administration is a victim of its own good fortune: With the US economy booming, illegal immigrants have a wider choice of work options — and more lucrative ones, too.

Not every illegal immigrant coming to the United States is seeking a job (or is attached to a job-seeker), but employment is overwhelmingly the most important reason they are lured here.

This problem can be mitigated. The federal government can and should mandate the use of E-Verify or another system to ensure legal eligibility to work in the United States and hold employers accountable to whatever degree of severity proves necessary.

The Trump administration could, if it so chose, order federal prosecutors to go after companies (and individuals) who employ illegal immigrants.

Deporting a few illegals, many of whom will only turn around and reenter the United States illegally once more, will not accomplish very much.

Putting a couple of dozen crooked contractors and meat-packing executives in a federal penitentiary for a good long spell would.

Removing the nuisance is one part of the solution. Securing the property is the other.

While additional border barriers would be useful in some places, as the current rush across the border makes so dramatically clear, the Trump administration’s monomania for wall-building is inadequate to the actual job at hand.

We’ll probably need some changes in areas that few people are talking about, such as banking, too.

For a long time, visa overstays — rather than Mexican border crossers — have been our most major source of illegal immigration.

People hate the term “comprehensive immigration reform” because it is often used as a euphemism for amnesty.

But effective enforcement will in fact have to be comprehensive: border control, visa control, and employment enforcement — and we’ll probably need some changes in areas that few people are talking about, such as banking, too.

It is remarkable that some legal businesses (e.g., marijuana-oriented concerns in states where they are permitted) have a more difficult time accessing financial services than do illegal immigrants, who are able to maintain bank accounts and take out mortgages, among other things.

Most illegal immigrants are not children.

They are adults and responsible for their own decisions. But as long as the promise of relatively well-paid work in the United States is enabled by a regime that can be charitably described as “lax,” it’s certain that many poor and unhappy people will risk coming to the United States and working illegally.

There is much that we could do to improve the economic and social situations in Mexico and Latin America, and we should do all that we can — if only out of self-interest. But there are narrow limits to what we can accomplish in other countries.

Which is why we should start with our own.