BOSS was a computer created by Global Chemicals. It was linked to a Human brain; chiefly Stevens, the director of Global Chemicals.
From being linked to a Human brain it learnt how Humans succeed; through illogic and inefficiency.
It made Stevens programme these 'qualities' into itself and became sentient, and meglomanical.
It was defeated confused by the Third Doctor by a conundrum:
If I were to tell you that the next thing I say will be true,
But that the last thing I said was a lie,
Would you believe me?