Shirk is giving to something or someone what is reserved for Allah S.W.T alone, and giving to others or other things what belongs to Allah S.W.T. alone.
Before defining shirk, worship has to be understood. Worship is a consequence of something else, mainly piety and fear (hushoo), that come from ma'arifa (Knowledge of God). From that comes knowledge of the attributes of God and realisation of Tawheed (Oneness), which lead to love, fear, devotion, trust (tawakkal) to Allah S.W.T. and more, they are the root of worship, and worship in itself. A person commits shirk if such person ascribes to others what is Allah's only mainly His S.W.T. unique attributes, ascribes other attributes of Allah S.W.T. equally to the creation, and disproportionates love, fear, devotion etc, to others or other things equally or more then to Allah S.W.T.
However there are degrees for everything and shirk is no exception. What defines the severity of it is what is hidden in the heart, that are followed by clear actions in every day life. The shirk of ascribing partners to Allah S.W.T. ie by attributing to them the unique attributes of Allah S.W.T. is the greatest form of shirk, comparing the attributes of the creation with Allah S.W.T. is the second and maybe equally severe as the first, and loving fearing etc, others or other things more then Allah S.W.T. is the last. In this are all the different states of the heart, ie vanity, pride, tazkiyat an-Nafs and more.
"Have you seen he who has taken as his god his [own] desire, and Allah has sent him astray due to knowledge and has set a seal upon his hearing and his heart and put over his vision a veil? So who will guide him after Allah ? Then will you not be reminded?"(45:23)