Apple is strengthening ties with Samsung as RAM prices surge, reshaping supply chains and influencing future device costs.