Superscripts were added to many of the Old Testament books and psalms by scribes, mostly during the Exilic or post-Exilic period. The superscript to Song of Solomon, "The Song of Songs, which is Solomon’s," only says that it is the best song ("song of songs") that belongs to Solomon. This reference to Solomon could mean that Solomon wrote it or that it was one of the songs in Solomon's collection - the scribe who added this superscript would not have known, either way.
It is most unlikely that Solomon wrote the song or even knew of it, as it is probably a much later composition. Grounds for assuming a later date include the use of expressions akin to Aramaic and the presence of certain foreign loan-words (Persian: pardes “orchard,” Song of Song of Solomon 4:13; appiryon from Greek phoreion “carriage” or [by way of Aramaic] “canopied bed,” Song of Song of Solomon 3:9). Either the Song was written after the Babylonian Exile or it was for some reason edited to include a few words that Solomon could not have known.
It is commonly assumed that the song is about Solomon and his lover, but a careful reading of the book proves otherwise. The singer is portrayed as a farm girl and her lover as a shepherd. “Do not stare at me because I am swarthy, because the sun has burned me. My brothers have been angry with me; they charged me with the care of the vineyards: my own vineyard I have not cared for (1:6).” Then, “Tell me, you whom my heart loves, where you pasture your flock, where you give them rest at midday, Lest I be found wandering after the flocks of your companions (1:7).” They make love in the fields, and she calls him her king, pretending that the trees are a palace – “the beams of our house are cedars, our rafters, cypresses.”