Looks like they came up short on the stub-up from the p-trap. They filled the underside with caulk, which has trapped gunk over time. Can't be completely sure based on the photos. A complete fix would require removing tile and the drain so it could be re-set.
Sorry for the bad news.
You can find many videos on the process on Youtube: