Hmmm, better is not a term I would use.
I can list some of the differences. Note that I owned the 3900 and own the Z7, but have never used the Onkyo.
* Audyssey vs YPAO; Audyssey is more sophisticated. Is it better? Maybe
* Network Audio; I don't know what the Onkyo supports; the Yamaha 3900 has Rhapsody which I like enough to pay them money; It's internet radio works well; It's ability to play music off your PC works, but is clunky
* Power; The Onkyo may have more, I don't know. The Yamaha has quite a bit, but sounds a bit harsh as you approach reference levels in my own system; I don't find it's power limiting for my own needs
* Sound quality; The 3900 sounds good to me. But that means nothing

* GUI; I really like the 3900's GUI; I know nothing about the Okyo
* Video; Both have sophisticated video processors; The 3900's options are a bit limited, you can't control the noise reduction settings as you can with the Z7; The 3900 had a perfect HQV score; In practice, I don't find the 3900's VP to be helpful even though it's really good, which just means you can only improve bad looking cable a little bit
* Analog to HDMI conversion; Nearly perfect on the 3900; You can hardly tell the difference between component direct, and component video converted to HDMI by the 3900
* Flexibility; The 3900 shines here; It's flexibility in input assignabilty really impresses me; There's a lot of options
* Ease of use; I find the 3900 to be pretty easy to use; The remote could be better in some ways; The interface to music stored on a media server sucks, IMO; If that's really important to you, and the Onkyo's is nice, that might drive you to the Onkyo
* Tuner; The 3900's tuner is very good, IMO
* Dolby Volume on the Onkyo; Yamaha does not seem to have anything comparable
* 9.2 on the Onkyo I think?; The 3900 only does 7 channels of amplification. It has height ambiance, but you have to use that or use the rear surrounds but not both; IIz and DSX are newer technologies compared to Yamaha's own presence processing (which I am not impressed by)
Onkyo seems to do very good with their price vs feature/power. Yamaha seems a bit more expensive. I think Yamaha may be slightly higher in quality based PURELY on anecdotal evidence in threads. In other words, I seem to see more problems reported with Onkyo than Yamaha. I would not take that too seriously if I were you, as there's no hard evidence. Yamaha has held up VERY well for me personally, and I think I have owned 6 of them (RX-570, RX-v795a, RX-V657, RX-V2700, RX-V3900 and the RX-Z7.)