In most of the theories or derivations we take some assumptions like has is ideal, frictionless piston and many more but these are not applicable in real world. But in our real life situations we apply these conditions though the cases are not ideal. Why?
Beacause the aim of physics is to build models that describe the reality, since the real world is too difficult to deal with . We know the exact solution just for a few physical system really simple to be treated, like the ideal harmonic oscillator, or perfect gas. The important thing is that although the real cases are pretty different from the ideal ones, you can still get excellent results with simple models based on the idealization of physical systems. Today, with numerical simulations, any analitical result can be improved by methods that add correction to a simple model, making the gap between physical modelization and reality smaller and smaller
In applying these theories or concepts to real life problems we do so but by removing the many constraints we imposed in order to get the theory in the first place. In quite many real life problems the underlying theory helps us broadly understand what is going on and the additional constraints help us observe the transition from theory to a real life scenario. For eg :- when a stone is dropped we know that it falls down in accordance with the law of gravitation. But we also know in order to understand the motion at each point and instant we would also have to factor in things like drag resistance due to air, etc etc. But roughly to answer the question "Why does a stone fall down?" the answer "Due to gravity." should infact suffice.
Firstly I would say that you are wrong in stating that we apply the ideal solutionsnto real world problems. It is almost impossible to get an analytic solution if we start off by trying to solve the real world problem. Instead, we assume a simpler model which is analytically solvable. When we have this solution, we next check how far off its results are from real values. Then we add various correction terms to it in order to get closer to a more realistic solution. This is much easier than trying to solve the much more difficult problem head on.