Can a fellowship be stopped suddenly? If not, why do PhD courses charge a fee?
This is a complicated question which depends on the country, university, discipline, and in some cases individual agreements.  


  Why do they even need to charge a fee then?


Here's a common situation for sciences:


Universities get grant money to conduct research.  Often it comes from a government.  The money can only be used for research purposes.
Universities use the grant money to pay students' tuition when they conduct research.
Tuition money can be used by the university for any purpose.  


Universities are incentivized to charge themselves as much as possible for tuition so that they can convert restricted grant funds to unrestricted funds.  


  Why is the scholar being charged a fee then? 


They usually are not.  The funds are deducted from the research budget and not paid by the PhD student.


  If a scholar starts a PhD with a promise that fellowship will be provided for 5 years, can the fellowship still be withdrawn before 5 years? 


If you read the fine print of the contract/offer, it probably has a loophole which allows funding to be cut off.


  Won't that put the scholar under financial duress? I'm asking these
  because before I choose to do a PhD somewhere, I need to know the
  financial risks.


Yes.  Universities want a way to get rid of bad PhD students.  Getting rid of bad PhD students hurts the university's reputation.  If you are not a bad PhD student, your funding will only be cut off if:


You are studying at a bad university or with a bad supervisor, in which case you should leave for somewhere better.
Some external disaster takes away funding.  This is a risk with any employer.  Example: https://en.wikipedia.org/wiki/Effect_of_Hurricane_Katrina_on_Tulane_University