Swedish sentences, just like English, require a subject. That's why there's an it in it rains and a det in det regnar. When used like this, Swedish always uses det. That's why you'll see det being used in constructions that often translate to "it's...", "that is..." and "there is..." even when what's described is an en-word.
I hope that makes it a little bit clearer. With practice and time you'll get the hang of it! :)