Romaji (ローマ字) is just the use of the Latin (Roman) alphabet to write Japanese. That's really all you need to know. Someone else can give you a history lesson if they want to, but it's not really necessary to know anything else
(don’t quote me on anything i’m going of head knowledge) From what i can gather romanji would have developed in the 1300-1400’s when the silk road opened up. and during this time was all of the samurai’s and stuff if i remember right, so it didn’t really have a use aside from the use it has now. teaching romanized people the language. However nowadays it’s actually used for more of foreign business purposes, for example: ikea, sony, monster 何何. actually if you look on the shibuya crossing square you can actually see billboards in romanji. and for the amount of actual people that can understand romanji i don’t know, but it does have a use aside from language
romaji is just the latin alphabet which we use to write english etc.
in japanese texts, you will sometimes see a few words written in romaji. for the most part this is a stylistic choice, making the word stand out or look fancy. some abbreviations are also regularly written in romaji.