Actually it's close to two borders -- Guatemala and Belize. Cancun is an L-shaped barrier island that now connected to the mainland by a bridge at each end. The lagoon between the mainland and the island provides some nice protected water for small boats. It was developed starting in the '70s as a resort area, complete with a modern water treatment & desalinating plant. The original Cancun is on the mainland at the northern end of the barrier island. It has a Wal-Mart, some churches and a Jewish community center -- none of which we visited.
Looking across the lagoon to the mainland:

Same sun, different night:

As long as you stay in the hotel zone (the barrier island), it's as safe as any resort area. I'm sure if you know where to look you can find drugs and/or dangerous areas, but neither was on our agenda.