The difference in English is that "one" emphasises that it's only one whereas "a" indicates that it's only one but without any emphasis. Generally in Swahili, if you don't need to indicate that it's only one, you simply don't include moja.
Wageni walikula nanasi = The guests ate a/the pineapple.
Wageni walikula nanasi moja. = The guests ate one pineapple.