The lumia 630 having 512 mb of ram performs tasks faster and smoother than moto g which has same specs but ram being 1 gb!
Because, JAVA programming language, where developers make app for android (Android studio), don't have method to empty garbage when user close it. Phone will empty garbage when that application notice that is no longer used it by user.
Other programming languages have that options, so when you close app garbage will be empty.
PS: Garbage consumes RAM memory.
If you want to know more about Garbage see here.
There is not a huge difference in the memory occupied by the operating system.
The main difference is due to the background activity. Android OS has almost no restrictions on background activity of an app, while Windows OS has some background restriction. This reduces the RAM memory occupied by the apps that run on background.
For example, In Windows mobile tiles/lockscreen are updated every 30 minutes but in Android it is for the developer to decide. Most of the apps(even the built in ones) are designed to run in background always.