Well, while it of course can be any time charged/addressed by the owners of the original series, fan games are still everywhere, in some fandoms they are quite big parts of the community.
For example, Hetalia and Undertale - while the first one is mostly a manga series (which also has 3 official games, but both incomplete as far as I remember) and the second one being an indie game, both were the base of A BUNCH of fanmade games. The fan games themselves even have their own little or BIG fanbases, take Dreamtalia and HetaOni's cases. HetaOni alone is already a huuuge part of the fandom. Earthbound and Yume Nikki are in a similar situation, with a lot of fan games being made for them and a lot getting just so much attention, it's incredible. Being really popular isn't necessarily a reason why a fan game is more likely to be taken down
From what I know, many games stay, even if they use the same characters or the same visuals, because the fan games are stated by the fan-creators to be non-profit and made for entertainment purposes - in other words, to share the fandom fun/love. Some games are taken down if the fan-creator(s) tries to make profit out of them OR if the fan game is made via hacking and directly modifying the game codes (for example, some Pokemon fan games were hunted down by Nintendo and shut down/removed for these reasons). Many of the fan games that stay available on the internet are, in the end, those made from scratch by one's own efforts, since the hacked & modified ones are more likely to be accused of copyright/trademark infrightment
*edit*
Forgot to mention this, but many companies have things like "Fan Content Guidelines" or "Guidelines to use our Intellectual Property", so basically the "terms of use"/rules one must follow as a fan creator to stay safe and legal. I wonder if
Kingdom Hearts (the franchise) has its rules stated somewhere on their websites, or perhaps Square Enix has those, so you might wanna search around if you find anything like that
oh, and maybe
this article will be an interesting or helpful read, so that you become more familiar with how some things works in this fangame world