For people who played both, how do you compare the two games?
Both are very much fun, but in a different way.
Civ IV can keep you on the edge until or almost until the end, the race can be on until the final turns. The general situation and diplomacy can be turned upside down from one turn to the next and several times during the game. There's lots of means of maneuver to change your direction.
In Civ VI there's much less dynamism on the world stage, and you can freeze your diplomacy for the game, if you know what you're doing, and it takes very little to learn that. In Civ VI, if you survived the start, you've basically won the game, so the question is not whether you will win, but how fast you can do that, and this challenge of shaving turns off of your victory times can be engaging and worth taking.
As for difficulty levels, as regards winning at all, I believe Civ VI to be 3 difficulty levels lower than Civ IV, meaning Civ VI Deity maybe corresponds to Civ IV Monarch.
How different are those games and what is the learning curve for new player?
They're quite different, they're somewhat the same
Civ VI has a lot of elements Civ IV did not have, it is a puzzle game: district adjacencies, unique improvements, city states with unique bonuses, competition for the unique great people, etc. The learning curve for a player completely new to civ can bee steep, but if you're familiar with any earlier civ, you'll have the background and pick up the new elements fairly easily.
Civ VI is quite complex and balance changes are still being made, fifth year in the development. With the NFP season pass we get new patch/update every month, and while it is nice, there are still all sorts of bugs. Civ VI have been plagued with bugs since the start, the most serious ones are eventually fixed, but it takes time. In the meanwhile new ones appear. The game is also terrible when it comes to giving information to the player, the UI is appalling, I suggest you look for some UI mods.
But on the whole, with Civ VI the devs said they wanted to make the players to play the map, and I think they achieved this very much, the map matters a lot and solving its puzzles will make you forget the time.