According to the theory of natural selection, organisms which are better suited for their surrounding environment have higher chances to survive and reproduce as compare to organisms which are poorly suited for their surrounding environment.
Darwin gave theory of natural selection and stated that all living organisms show variations, which are essential for evolution of a new species. Hence, it is known as theory of evolution by natural selection.
Most organisms either directly or indirectly use energy from the sun to survive, but not all of them. Plants and some microbes use the energy from the sun to perform photosynthesis.