This is a very strange play. While Shakespeare stayed within the bare conventions of his time in writing plays he is fundamentally an experimental author and this play is one of his more experimental works. The play is nominally a comedy but the first three acts read like tragedy and then the comedy breaks out in earnest for the last two acts. The play also contains pastoral themes, but it has a plot that is essentially a folk tale. The plot is that a King becomes jealous of his wife who then dies with her son of the shame more or less and the daughter who the King believes his daughter is illegitimate exiles her. She becomes lost and is raised by a simple shepherd when a handsome prince falls in love with her. They then flee for love before the mystery is solved and everything works out fine.
The tone of the play dramatically changes at the conclusion of the third act. Up until that time the play is primarily a sort of Sophoclean tragedy and then it becomes Shakespeare at his silliest. The last two acts are as silly as As You Like It, up until the weird denouement of the play. Its clearly Shakespeare trying to experiment and the influence of fairy tales is very plain. The psychological realism is not there and the characters act as archetypes. Too me the whole thing prefigures something similar in the Tempest, but here it does not really come off. The play fails to cohere and the shifts and characters don't quite work. However, it was probably a necessary experiment that allowed the Tempest to be written later. The Tempest does something similar, but it works. It reminds me of Timon of Athens which is also a noble experimental failure and that play in my opinion prefigures King Lear. The play is very weird, including an unnecessary bear attack, which is quite confusing. The characters don't quite gel either.
I don't begrudge Shakespeare's failed experiment, because Shakespeare failing is better than most authors succeeding. That being said the only play that I have read by Shakespeare that I think is worse is Timon of Athens. Weird and strange.