Nute Gunray was under direct command of the Sith Lord Darth Sidious. This was the Sith alias of Senator Palpatine. Sidious commanded Gunray to invade Naboo. By creating an artificial conflict, Sidious could gain sympathy for Naboo in the senate. He could use this sympathy along with the Republic's lack of action to achieve the political position of Supreme Chancellor. Nute Gunray was just a pawn in Sidious' plan to achieve the position of supreme chancellor. By working as the necessary opposition, Gunray was not aware that this was his purpose but despite this Sidious was able to ascend to Supreme Chancellor and he would not be able to do this without Nute Gunray.