?? ??

So I have a friend who comes and goes when they want. They didn’t use to be this way until maybe 6 months ago. Anywho, one week they are around and will talk and then out of no where disappear. Won’t answer any text messages or nothing. No response whatsoever. So yeah I get worried and upset. Might someone explain why someone may do this? I’m just trying to understand this person and if there are others out there like them?