Binary Tree to Binary Search Tree

When we convert Binary tree to Binary Search Tree…
The Algorithm like this

  1. Inorder and store in Array
  2. Sort the Array
    3 Again Inorder on the Array.
    can anyone clear my doubt what the logic behind this.

Thanks