They arent random. Theyre like stanza headings. Each is a letter of the Hebrew alphabet. This psalm ir song is an acrostic. In Hebrew the first letter of each line in each stanza starts with the letter it is headed with. In my KJV they are actuall translated: Aleph, Beth, Gimel, Daleth, He, Vau, Zain, Cheth, Teth, Jod, Caph, Lamed, Mem, Nun, Samech, Ain, Pe, Tzaddi, Koph, Resh, Schin, Tau. So in the first stanza each line starts with Aleph or (Alef) when written in Hebrew. Each line of the secind stanza starts with the Hebrew letter Beth. And so on. This was done because this passage was considered one of the most important, and also one of the longest and making it an acrostic made it easier to memorize.