Isn't that obvious?
North Korea has always been ahead in areas like ballistic missiles and submarines—indeed, many of Iran's advances in these areas owe much to North Korea.
Iran is fundamentally ahead of North Korea in more conventional military areas, such as tanks and armored fighting vehicles, fighter jets, naval vessels, UAVs, radars and electronic warfare, etc., but in those areas North Korea has also caught up or even surpassed Iran in recent years.
I think Iran's biggest problem is the division of R&D resources between the regular armed forces and the IRGC, while North Korea does not have that division and its entire development effort is centralized under Party directives.