How do plants get carbon? From air or soil? How is it different for aquatic plants and algae?

According to <https://en.wikipedia.org/wiki/Soil_organic_matter> soil has 3.3 times the size of the atmospheric pool of carbon.