What is the difference between these two sentences? 我跑了3公里的步 vs 我跑步跑了3公里. They both mean "I ran for 3 km", right?
跑 | 3公里的 | 步


跑步 is a simple (verb) + (noun) structure: 跑 (verb) + 步 (noun)
3公里的 is a relative clause of the noun 步, that describe the length of it.
The relative clause 3公里的 is inserted between the verb and the noun 跑 | 3公里的 | 步

跑步 | 跑了3公里 is a (topic) + (statement) structure


跑步 (topic) + 跑了3公里 (statement)



The difference between #1. and #2. is:


treat 跑 | 步 as (verb) + (noun), then add a relative clause for the noun


The typical is :S+V+O.


他（S）跑(V)步（O）跑了三公里（补语）。
Notice that We can totally ignore “跑了三公里”, so this is just answering for "How long did he ran"？So that's 3 kilometers.