As people come close, two major things take place. First, you get attached to their words and everything they do, secondly you start presuming how he/she might behave or reply the way you want and when you want. As the closeness to the person increases, the pain you feel on the breaking of your expectation also increases. Hence one can conclude that expectation is a function of closeness.
And mind you, it is an original sin present even in a 5 year old kid or an old person living his last few days on earth. But the control parameters necessary to handle expectations might vary. A 5 year old might cry if his expectations won’t get fulfilled but an old man would behave very differently possibly in an ideal way, I assume.
Let me tell you how to deal with it. There can be two possible outcomes if your expectation is not fulfilled. Either the person exceeds your expectation or he/she suffers miserably on it. In the first case you better make it clear to yourself that his exceeding your expectations shouldn’t change the way you expect things from him. Now if he fails miserably you should provide yourself a negative feedback (a science jargon!) which means to make your expectation wanting system to slow down. Understand why he/she couldn’t live by your thoughts, there can be ‘n’ number of reasons you would have never thought of before expecting the outcome from him/her. Hence take into account all those reasons into your reality before forming the next expectation. I hope this makes you understand how to make expectations work by your way rather than the opposite.
One thing is certain that you cannot runaway from expecting things from your close ones as well as living as per the expectations of them. So instead understand and may be improve your system, be a mature person and handle expectations in a positive way.