The bitcoins themselves never really exist, only receipts from previous transactions. So if received that 1 BTC from a friend, you have a receipt somewhere saying that he sent you 1 BTC. You can then reference this receipt in a future transaction as proof you do own 1 BTC. This is how bitcoins exists, as receipts. But the indivisible part comes from the fact you can only reference a receipt once and only once, never twice. Even so, when you finally do reference it you can split it up however much you want (with some limitations), deciding who gets how much of the bitcoin referenced in the receipt. Whatever is unaccounted for the miners get, this way the entire value of the receipt is spent, always. So obviously using the receipt again in a future transaction would be pointless as it's now worthless, if it were even possible.
To get your change you simply send to two people at once. One output with the value of 0.22 to an address Alice owns and another with 0.78 to an address you own. The receipt you had proving you owned 1 BTC has now been fully spent and can never be spent again, but in its place two more receipts have been created, which in turn can be used in a future transaction, but only once.
Another way of thinking about this is that you can't divide a bitcoin without letting the bitcoin network know about it. If you want to split up a bitcoin you own, you need to create a transaction doing so first. So you could create a transaction sending yourself 0.78 BTC and 0.22 BTC referencing your receipt for 1 BTC, then afterwards send the 0.22 BTC in its entirety to Alice, no change needed. Though honestly the question whether you divided up the 1 BTC or created two entirely new coins while the original 1 BTC remained indivisible seems to me to be more a question for philosophy.
Said shortly, when you spend a bitcoin you have to use the entire coin all at once (indivisible part), but in the process you can create as many smaller bitcoins as you want (divisible part) and give some back to yourself as change.
Thank you. I suppose I had been thinking about it like this - if I give a cashier $20 for a $15 item, they will give me $5 back in change, but that $5 has to come from somewhere. But it seems a bit arbitrary - I don't get why then, if the outputs can be split exactly, then why the inputs can't be split so I only spend the exact amount I want. – rb612 – 2017-07-15T06:56:02.490
Because there has to be a "paper trail" - that's how the protocol was designed. The splitting is done in the same way as all transactions so that there is a record, like all transactions. – wizzwizz4 – 2017-07-15T15:40:48.040