Apple still makes a good deal more revenue.
For quite some time, Amazon made almost no profit and just spent everything they earned. I believe they recently started taking in more profit, and this has probably excited the stock price a lot.
Amazon also seems to do things Apple isn't willing to. Amazon hosts the NSA's data, while Apple fights for privacy. Amazon has notoriously poor working conditions and unethical sources, while Apple leads in creating an ethical supply chain, using green energy and making recyclable products.
Apple's strategy means they're virtually the only ones who can sell phones, tablets and computers for a decent profit margin. Amazon's strategy shows they're willing to be cut throat. Both are attractive to traders in about equal measure, it seems.