Abarim Publications' online Biblical Greek Dictionary
The prefix εκ (ek or ex when followed by a vowel) means of or from when a situation is described in which an object or person becomes separated from what it was previously one with; it's the opposite of εις (eis), meaning in or into. It differs from the similar prefix απο (apo) in that the latter often describes a distantiation of elements that were separate to begin with, and existed next to each other.
Our prefix εκ (ek) attached to verbs of motion or direction is used to describe a coming out of a place (Matthew 2:6, Mark 1:11, Luke 5:3, John 19:23). It may mark a source or origin (2 Corinthians 4:7), or place of residence (Luke 8:27, Acts 4:6) or the commencement point of a period within which events occur (Matthew 19:12, John 9:1). It may denote the source of result (John 4:6) or of motive (Philippians 1:16) or of manner or mode (Matthew 12:34, Luke 10:27).
In the sense of a going out as exceeding, our prefix is frequently deployed to form an intensive form (comparable to the out-part of the English word outstanding).