Primarily, the torah was given to be a living document, subject to certain modes of understanding and application. In order to establish a system of that understanding, the chumash instructs the people to adhere to the particular teachings of those who, in each generation, are the authorities based on their learning and understanding. The torah is not in heaven, but on earth for us to live by so we need the experts who satisfy particular criteria to be those who help us live our lives properly. Pesukim 8-11 of devarim 17 point out the process and hand the mantle of that judicial and interpretive authority to the leaders of each generation.
ח כִּי יִפָּלֵא מִמְּךָ דָבָר לַמִּשְׁפָּט, בֵּין-דָּם לְדָם בֵּין-דִּין לְדִין וּבֵין נֶגַע לָנֶגַע--דִּבְרֵי רִיבֹת, בִּשְׁעָרֶיךָ: וְקַמְתָּ וְעָלִיתָ--אֶל-הַמָּקוֹם, אֲשֶׁר יִבְחַר יְהוָה אֱלֹהֶיךָ בּוֹ. ט וּבָאתָ, אֶל-הַכֹּהֲנִים הַלְוִיִּם, וְאֶל-הַשֹּׁפֵט, אֲשֶׁר יִהְיֶה בַּיָּמִים הָהֵם; וְדָרַשְׁתָּ וְהִגִּידוּ לְךָ, אֵת דְּבַר הַמִּשְׁפָּט. י וְעָשִׂיתָ, עַל-פִּי הַדָּבָר אֲשֶׁר יַגִּידוּ לְךָ, מִן-הַמָּקוֹם הַהוּא, אֲשֶׁר יִבְחַר יְהוָה; וְשָׁמַרְתָּ לַעֲשׂוֹת, כְּכֹל אֲשֶׁר יוֹרוּךָ. יא עַל-פִּי הַתּוֹרָה אֲשֶׁר יוֹרוּךָ, וְעַל-הַמִּשְׁפָּט אֲשֶׁר-יֹאמְרוּ לְךָ--תַּעֲשֶׂה: לֹא תָסוּר, מִן-הַדָּבָר אֲשֶׁר-יַגִּידוּ לְךָ--יָמִין וּשְׂמֹאל
However, this power is not as extensive as it seems. Rulings cannot be capricious because they must be grounded in the tradition and accepted normative exegetical rules which are part of our tradition. The explicative methods and the legal implementations that we use now are not innovations and are bound severely by all that has come before.
edit -- I found this discussion of a similar question and thought it might be of help
http://dixieyid.blogspot.com/2007/11/why-does-all-rabbinical-authority-come.html