The stack view ensures that the arrangedSubviews array is always a subset of its subviews array. Therefore, whenever the addArrangedSubview: method is called, the stack view adds the view as a subview, if it is not already. Whenever an arranged view’s removeFromSuperview method is called, the stack view removes the view from its arrangedSubview array.
From Apple's doc: