Probably, .Gov and .Edu sites are authorized and google always respects authorized sites. . And yeah ofcourse it gives some importance to those sites, and Quality of those websites also really matter. .
I hope you are about to ask .gov and .edu (not .org)
Thanks