In a bag there are $1007$ black and $1007$ white balls, which are randomly numbered $1$ to $2014$. In every step we draw one ball and put it on the table; also if we want to, we may choose two different colored balls from the table and put them in a different bag. If we do that we earn points equal to the absolute value of their differences. How many points can we guarantee to earn after $2014$ steps?
1. **Initial Setup and Problem Understanding:**
   We start with 1007 black and 1007 white balls, each numbered from 1 to 2014. We draw one ball at a time and place it on the table. We can choose to pair two balls of different colors and earn points equal to the absolute value of their differences.

2. **Objective:**
   We need to determine the maximum number of points we can guarantee to earn after all 2014 steps.

3. **General Strategy:**
   We will show that if there are \(2k\) balls initially, the maximum points we can guarantee is \(k^2\).

4. **Mathematical Formulation:**
   Let \(T_p\) be the sum of the points we earn after 2014 steps. Each point is the absolute value of the difference between two positive integers between 1 and \(2k\). We need to show that \(T_p \leq k^2\).

5. **Summation of Points:**
   The maximum possible sum of differences can be represented as:
   \[
   T_p \leq \sum_{i=1}^{k} (2k - i + 1) - \sum_{i=1}^{k} i
   \]
   Simplifying the above expression:
   \[
   T_p \leq \left(2k + (2k-1) + (2k-2) + \ldots + (k+1)\right) - \left(k + (k-1) + (k-2) + \ldots + 1\right)
   \]
   The first sum is the sum of the first \(k\) terms of an arithmetic series starting from \(2k\) and decreasing by 1:
   \[
   \sum_{i=1}^{k} (2k - i + 1) = k(2k + 1) - \frac{k(k+1)}{2}
   \]
   The second sum is the sum of the first \(k\) natural numbers:
   \[
   \sum_{i=1}^{k} i = \frac{k(k+1)}{2}
   \]
   Therefore:
   \[
   T_p \leq k(2k + 1) - \frac{k(k+1)}{2} - \frac{k(k+1)}{2} = k(2k + 1) - k(k+1) = k^2
   \]

6. **Inductive Proof for Pairing:**
   We will use induction to show that for any \(k\), there exists a one-to-one function that maps elements of \(A = \{2k, 2k-1, \ldots, k+1\}\) to \(B = \{k, k-1, \ldots, 1\}\) such that each pair consists of one black and one white ball.

   - **Base Case (\(k=1\)):**
     For \(k=1\), \(A = \{2\}\) and \(B = \{1\}\). The pair \((2, 1)\) satisfies the condition.

   - **Inductive Step:**
     Assume the claim is true for \(k=m\). For \(k=m+1\), consider \(2m+2\) balls. Without loss of generality, assume \(2m+2\) is black.
     - If \(m+1\) is white, pair \((2m+2, m+1)\) and the remaining pairs follow the \(k=m\) case.
     - If \(m+1\) is black, there exists a pair \((a, b)\) where both \(a\) and \(b\) are the same color. Pair \((2m+2, b)\) and \((a, m+1)\), and the remaining pairs follow the \(k=m\) case.

7. **Conclusion:**
   By induction, we have shown that it is always possible to pair the balls to achieve the maximum points.

The final answer is \(\boxed{1007^2 = 1014049}\).