Perhaps the biggest difference is ownership. Mysql is owned by Oracle and, though free, is not considered open source. It was acquired by Oracle in 2010. Its creators felt there was a conflict of interest so they left to start MariaDB.
MariaDB is owned by the MariaDB Foundation and is considered completely open source. It was built by the same people who built Mysql as a drop-in replacement for Mysql.
You should have no problems migrating your code from Mysql to MariaDB. I run on several different servers at least one of which runs Mysql (while the others have already migrated to MariaDB) using the same code with NO changes.
There's a lot more to it than what I've mentioned here. But I hope I have, at least, helped answer your question.
I Personally, I prefer MariaDB.