The law of conservation of energy makes sense to me in certain systems but in others I can't seem to comprehend it. For example, a car moves because the stored chemical energy within its fuel is converted to heat and mechanical energy which in turn makes it gain kinetic energy. In this scenario the law makes complete sense because the potential energy within the fuel is being used to make the car work. Therefore the energy that was stored is equal to the one that's lost in heat and sound + the one thats making the gears move and making the car gain kinetic energy. But in context of solar panels, they're generating electricity by gaining heat energy. But aren't they technically just creating energy instead of gaining it from the sun? Because on a larger scale, how fuel gets burnt and loses it's energy to the motion shouldn't sun too lose it's energy to maintain equilibrium? Same with wind?
[Physics] How do solar panels and wind turbines prove the law of conservation of energy
energyenergy-conservationrenewable energy
Related Solutions
A conservative force only returns the energy back when the object moves in a closed path, that is, it returns to the initial position (it doesn't matter if he returns due to other forces). This can be demonstrated as a theorem, but the intuitive explanation is that a conservative force depends only on the spatial coordinates, and not in the direction of motion (such as friction), and thus eventually when the body moves back the field force is in the opposite directions and makes work of the opposite sign, such that in a closed loop the overall work of the field over the particle is zero. The additional property for a field is that this happens regardless of the path taken (that is, you do not need to go back to the original position using the same path you used when moving forward. This can be shown to be the case when the force is described as the gradient of a potential.
Update: I reread your question and I realized that I didn't actually answer your specific question (I misinterpreted the question). Let us start with the easy case: a mass attached to a spring. Here your body is the mass and the agent is the spring. Describing the mass moving in a conservative field instead of describing it in terms of mutual forces is much easier, as we do not have to take into account the details of the internal forces within the spring. The mass losses energy and this energy is stored in the spring, not in the mass. However we can give an alternative description ignoring the spring and saying that the mass accumulated potential energy. This is very convenient, but only if your are sure that the spring will always be attached to the mass (so you can describe the force from the spring as conservative). But if you cut the spring when the mass is at rest, the mass will "suddenly lose" its potential energy (the force is no longer conservative), the energy was actually in the spring an will be dissipated as heat (assuming the spring will eventually stop moving, as in a real spring).
In the case of long distance forces that cannot be switched off, such as gravity, the description is a little more complex. If you have a very large
mass as the agent, you can approximate it as not moving due to the reaction force from the object, and describe the object as moving in a potential
field where it stores potential energy. A more accurate description would be that the agent actually moves and gains this as kinetic energy (when the object moves "up",
the earth will follow it and also move up too so it gains kinetic energy). But this motion is so small that you do not take it into account in your description. For all practical purposes the
object sees the agent as being at rest. Of course, I am assuming that you can move the object with a force that doesn't interact with the agent, otherwise it is the same but this time
the agent might be storing the energy in some different way, however the details do not matter for all practical purposes.
Best Answer
The sun is turning hydrogen into helium, which produces energy from mass. This energy is ultimately radiated as an enormous amount of light: about $1370\mathrm{W}/\mathrm{m}^2$ reaches the top of the Earth's atmosphere.
Solar panels take some of this light energy and make electricity from it (note they aren't using what we would think of as heat: they need shorter-wavelength light).
Wind turbines work indirectly: some of the incoming energy from the sun ends up heating the atmosphere: differential heating causes movement of air, which is wind. This movement has kinetic energy, and wind turbines extract energy from this. The processes involved in turning sunlight into wind, while straightforward in principle, are actually extremely complex in detail.
So both of these systems rely on energy coming from the Sun. Of course, so does a car: in the case of a car, light energy from the sun gets captured by photosynthesis and turned, ultimately, into oil. That captured energy is then used, eventually, to run the car.
So the only place, in this entire system, where energy is 'not conserved' is in the Sun. And that's because, of course, energy and mass are really the same thing, and this is what is conserved. So the Sun is (very slowly) turning some of its mass into energy.
Finally note that the law of conservation of energy can't be proved: physical laws can only be disproved: this is an important point to understand. What you should ask, rather, is how do wind turbines & solar panels agree with energy conservation, or how do they fail to disprove it, not how do they prove it.