Q:

What is the difference between -(어/아/여)야 하다 and -(어/아/여)야 되다?

I have learned that in order to express must/have to in Korean, you use-(어/아/여)야 하다 and -(어/아/여)야 되다 (depending on the verb stem, you might use 어). 
For example: 

너는 밥을 먹어야 한다. vs 밥을 먹어야 된다. (You should have a meal)

However, I wonder if there is any difference between - 하다 and - 되다 to express the obligation. 
In other usage, I hear that the former is for active while the latter for passive. But according to a similar question on other websites, it is exactly the same, though it might be a slightly different use case.
So is there any difference or is this just a synonym? My textbook doesn't distinguish them, for your information.

A:

This is an excellent and clear question. I have had this question  myself many times.
Before living in Korea, I was in a 3-month intensive language training program for Korean. We were taught that the imperative form (which is the whole base of the question here) was 아/어/여 야 하다. However, when I went to Korea, I heard
아/어/여 야 되다 almost exclusively 
I do not have any hard and fast grammar rule for you here, but in my experience in living in Korea for a few years and also obtaining a Korean degree in college, the verb endings 

아/어/여 야 하다  

and

아/어/여 야 되다

were used pretty much interchangeably. But they were not identical. Again, as I said, this is not a grammatical difference, but a difference in feeling or register.
아/어/여 야 하다 tends to be stronger and more imperative. It has a more emphatic feel. 
아/어/여 야 되다 is weaker than the 하다 form. It is less forceful. I think that this is why it is more common; it comes across as less demanding.
I say this commonly, but a huge thing that hold up Korean learners is that they want a one to one rubric between Korean and English. They want to know exactly when to use each form. Black and White. 
When to use each of these forms is more a matter of feel and less a matter of right and wrong. They are grammatically equivalent; however they show a different level of imperative necessity. 
Take the example sentence as follows:

We need to go.

How do we translate this into Korean? Well, how imperative is it? Written English is somewhat deficient in this regard. The only way to know the true emphasis intended is to hear the sentence spoken.
But now look at these two sentences:

"We need to go now." versus "We need to go. Now."

The written emphasis is slightly different. The second sentence shows more imperative necessity than the first.
In my experience, the two sentences above show a good example of how to use 아/어/여 야 하다
and
아/어/여 야 되다.
Translated, the two English sentences could be written

"가야 돼요" versus "가야 해요"

The second one has a feeling of emphasis and higher necessity. 
(I will leave the discussion of which 체 [register or politeness level] to be using here for another day. There are cases for both sides). 

