As far as I know, my Russian teacher never taught me why such things happen... And I've encountered so many cases other than these examples bearing same problems. Can somebody explain when and why this happens?
Russian Language Stack Exchange is a question and answer site for students, teachers, and linguists wanting to discuss the finer points of the Russian language. It only takes a minute to sign up.Sign up to join this community
These are so called lesser cases (малые падежи).
С боку на бок - отложительный падеж, or исходный падеж (ablative).
Брал меду - отделительный падеж, sometimes also called количественно-отделительный падеж.
About lesser cases: What are the lesser known Russian cases?