Niyyah means intention, attention and decision. In Salah, it means the worshipper intends to do what God has commanded with the aim of getting closer to God and has no other intention than doing what God has ordered.
A Muslim’s Niyyah in every action, especially in acts of worship, must be Qurba (getting closer to God). That is to say, he should do everything for the sake of God and with the intention of getting closer to God, not for pretention or any other purpose.
Niyyah is one of the Rukns of Salah. Rukns are essential parts of Salah that are necessary for its validity.
During Salah, the worshipper must maintain his Niyyah keep his attention to the act of worship as act of worship without Niyyah or with materialistic Niyyahs have no validity.
Niyyah is a precondition for acts of worship to be accepted by God. God only accepts those acts are done with pure intention. If the Niyyah is pure, even small actions become valuable and precious but without a good and pure Niyyah, actions will be invalid no matter how big or numerous they are.
So it is necessary that our intention in acts of worship, including in Salah, must be pleasure of God and getting closer to him only.
Of course having Ikhlas (purity of intention) is not that easy as Satan is always seeking to do all he can to bring impure intentions to our hearts. So we must confront Satan’s temptations and try to do everything for the sake of God.
Imam Ali (AS) says purify your action, your knowledge, your enmity and friendship, your words and silence for the sake of God.
If one does everything for the sake of God, even those actions that are not acts of worship turn to acts of worship because of the purity of intention.
Niyyah means all of the Salah, always and everywhere must be for God. Otherwise it would be invalid.
One who works for God and acts for the sake of God will not get tired or lose hope. He will not get upset if people ignore him nor will their encouragements will have any effect on him. Ikhlas produces a kind of power in mankind that encourages him to do good everywhere and at any time.
Imam Ali (AS) said all actions will be void except those in which there is Ikhlas.
So Niyyah is the main element in every act of worship and the basis of deeds.
If two people are standing in Salah next to one another, the Salah of the one who has Ikhlas in Niyyah is better although both are doing the same thing.