What exactly is the difference between the following two sentences?
What is to be done?
or
What has to be done?
What is to be done?
means, "What will be done in the future?"
What has to be done?
means, "What must be done?"
The first sentence is expressing plans or intentions. The second sentence is expressing obligations or requirements.