That's years of neglect on owners NOT cleaning their cars when washing. Water and everything else will just collect there, then dry, leaving all the "smutz" to bake. If you wash your car regularly, dry ALL the channels, including the door sill areas, you won't have that collect.
Looking at it on a PC i still can't tell what that is. I wonder if a previous owner had a water leak at the seam in those corners and decided to try some sort of band-aid solution and that's the end result?