The dot originated on the cursive “i”, to make reading easier. For example, without it, the words “mama” and “mania” would look very similar.
People got used to it and so it ended up on the print version of the letter too. And then when the letter “j” evolved out of a stylized version of the letter “i”, it inherited the dot.
History of English Podcast just spend a great deal of time on that very issue in the most recent episode: [https://historyofenglishpodcast.com/2022/08/31/episode-161-y-u-and-i-have-a-problem/](https://historyofenglishpodcast.com/2022/08/31/episode-161-y-u-and-i-have-a-problem/)
Basically they were added at a time when the language was written in a “block letter” script — very Germanic. Downstrokes were thick and heavy and horizontal strokes very hard to see. In that script, many letters including i l u n and m were very hard to distinguish and so writers and then printers took measures to make them stand out.
i was made to stand out in two ways, by adding a dot onto the top or by extending the letter below the line like we write a j.
These two distinguishing features were then later separated into two distinct letters.
Latest Answers