Welp, it's pretty unlike for a player to find you in such a wide world, unless your house was twenty blocks away from spawn, but the fact that yoy were underground makes it more unlike.
Probably you either:

  • leaked your own coords, maybe your intent was to private message somebody but you forgot to type /tell before the actuall message
  • accepted an unwanted random TP from a stranger who might've pretended to be willing to help you.
  • maybe it's just an unlucky coincidence...

It's not like random people pop out of nowhere...
Be careful next time

Or if you're already gone, goobye