I've never really understood where the line gets drawn when it comes to copyrights. Sometimes it seems like even acknowledging another franchise exists is enough to get the pants sued off of you, other times its like you can rip off names, character designs, and even entire plots, and the owners can't do anything about it.
Bottom line: is "He didn't want to throw away the cool robe that made him look like a Jedi" going to get me into hot water with the Mouse?
From what I recall; generally you can name anything that the public is understood to have known, while some companies have tried to be an ass about trademarking common words, you cannot copyright language as a whole and only trademark extremely specific nouns, usually invented, taken out of context 'Apple' or otherwise distinctive words. Trademark law specifically cares about the understanding in context, and that is where people try to cite 'parody'.
By the true definition in copyright specifically, a lot of parody is protected
when it comments on or critiques the original work, but can also be specifically marking the IP in question as your own product, such as a pokemon themed story would infringe upon the IP rights, because you don't own part of the world, but having a Pikachu plush show up in your cyberpunk theme story as a thing on someone's bed won't usually be a legal issue.
Trademark law doesn't consider parody an automatic protection unless the usage is clearly signalled as not part of the original source and thats why people run into issues at times because they consider saying a few things or making fun of something an automatic protection on the multi-front fight which is copyright and trademark laws individually.
When it comes to stories, google isn't going to come after you for naming their site in a story, same for a lot of stores and otherwise; especially if they aren't in a competing or adjacent format or industry. It's generally understood as nominative use to just refer to a brand or representatives of a brand such as Micky Mouse.
A few game developers have made games in the past that shared names with real world companies and that has fallen through in court because they aren't in the same industry, therefore people would have 'no reasonable expectation' to confuse the two.
Well known brands however do have the weight to push for dilution because the 'value' of their name is being picked up and misused by other people.
When it comes to fanfictions, generally all fanfictions without explicit permission are already a baseline infringement even if non-commercial.
Copyright cares about characters, settings and narrative elements to be 'sufficiently distinctive'. The main difference is enforcement varies because theres so much content online that only more popular things get constantly curated. All it takes is Nintendo sending a cease and desist to ScribbleHub however for them to require all stories relating to their games to be removed, they just haven't chosen to.
If you take someone's world and characters and actively turn it into a gore filled horrorscape, they are going to be a lot more trigger happy to cease and desist you, because it is their IP, and you are in a competing field such as the creative arts or completely misrepresenting the identity of their IP.
In the end popularity tends to signpost once something becomes legally and commercially relevant, they can't be sure people aren't taking donations or other things from their projects, and so they are shut down.