As what I have seen from the story, it gives moral lessons to everyone and I can really relate to the story. It is about a girl who is cursed by a sage because of obsession or thinking too much about his loved one and forgot the presence of his visitors.
If Shakuntala were the daughter of two brahmins, then she would only be permitted to marry another brahmin. It later emerges that the King needn’t have worried, since Shakuntala’s real father was a member of the princely class, making her eligible to marry him. In any case, the King is so taken with Shakuntala that he’s already thinking.