(Preface: this answer mostly uses examples of licensing in North America / the USA because that's what I'm most familiar with. Keep in mind that a show that isn't licensed in North America may still be licensed in other regions of the world, such as Australia, Europe, China, and so forth.)
Therefore, I am asking what is the difference between licensed and unlicensed anime and manga?
"Licensing" here refers to the process by which a party that is not the original creator/distributor of a piece of content acquires rights to distribute that content, usually with the limitation that they may only distribute the content in a certain country or part of the world.
Since Funimation has licensed One Piece (I believe in North America only), they are authorized to legally distribute One Piece to consumers in the region for which they have licensed it. (I'm not sure who, exactly, the licensor for One Piece is, though I suspect it's the original manga publisher, Shueisha.)
Free! Eternal Summer is not a good example of an unlicensed anime, because it has in fact been licensed for streaming in North America by Crunchyroll, though I'm not sure if it has been licensed for home video.
Consider instead an earlier Kyoto Animation show: Hyouka. As far as I know, nobody has licensed Hyouka anywhere for any purpose (and this makes me very sad). This means that if you want to consume Hyouka through legitimate routes, your only option is to purchase the Japanese BDs/DVDs, or find someone who DVRed it in Japan, or something like that.
Usually, I see that all anime and manga are licensed! But sometimes I see that some anime or manga are not licensed. Why is that so?
If an anime or manga is unlicensed, it is because no company has bothered to purchase a license to distribute the product in the region where you live.
Note that while the majority of new TV anime produced these days are licensed (at least for streaming in the US), the fraction of manga that are licensed relative to the total amount produced is still very small (though this has been slowly changing with the advent of manga "streaming" services like Crunchyroll Manga). If you usually only run into licensed manga, that just means you're mostly only consuming manga through legitimate, licensed providers outside Japan.
And what does that mean for the producers, television stations, websites (and other who "buy" and publish the anime/ manga) and for the anime/ manga fans?
If an anime or manga has not been licensed in your region, it means that there is probably no legal way to consume a version of the product that has been adapted for consumers in your region (i.e. by subtitling, dubbing, localizing, 4Kids-ifying, etc.). Of course, this has never stopped anime watchers.
Also how does the process for licensing an anime work?
This is a complicated topic, and is worth a whole question on its own. (And also, I don't really know the answer beyond vague generalities.)