That is a really good question that usually books fail to address in an intuitive way. Let me give you a step by step intuitive explanation by looking at the Atwood's machine:

[![Atwood's machine][1]][1]

Start with the balance of forces around the cable:

[![enter image description here][2]][2]

$$𝑭_𝟐−𝑭_𝟏=𝒎𝒂$$

F2 is greater than F1 since the cube has more mass than the sphere. Now we use the common assumption that textbooks use, that is, assume that the cable's mass is insignificant: $$m = 0$$

So the first equation would yield:

$$𝑭_𝟐−𝑭_𝟏=0(=) 𝑭_𝟐 = 𝑭_𝟏 $$

What is strange is that we are applying different forces at the cable's ends, however the cable "feels" two equal forces. But we clearly know that F2 and F1 aren't the same. So what is this force that the cable "feels" at its extremities? Let's call it tension, T:

[![enter image description here][3]][3]

Since the cable is "feeling" to equal forces, T, at its extremities, then it will react against the bodies it is attached to, with also a value of T. That's why in the Atwood's machine from the first figure, a tension T is applied against each body. Remember this is only true with the initial assumption (m=0), and a more realistic approach is mentioned in danimal's answer. 

Of course you now can calculate what is the value of T by analyzing the FBD of the sphere and the cube. I'll leave that up to you.

Clue: assume that both bodies have the same acceleration: if the position of the cube goes downwards 1 unit, then the position of the sphere goes upwards also 1 unit (thanks to the cable which has a constant length). Since the displacements (absolute value), $r(t)$, of the bodies are the same over time, then their derivatives are also the same, meaning that $a_1 = a_2$, where $a_i$ is the resultant acceleration on body i.


  [1]: https://i.sstatic.net/p18vg.png
  [2]: https://i.sstatic.net/MoRLJ.jpg
  [3]: https://i.sstatic.net/6YU7l.png