Isn't each transaction dependent on a hash of the previous transaction?
Yes and no.
Yes, in that each transaction must be created using valid inputs (ie, referencing a valid UTXO to be consumed as an input). No, in that transactions are not 'dependant' on the previous transaction's hash in the same way that blocks are 'dependant' on the previous block's hash.
For blocks, the hash has an extra level of importance, in that the hash of the block must be a valid proof-of-work on the network. Each block must have a valid hash, and also reference a valid previous block. For transactions, this extra layer of 'valid proof of work' is not required.
(Note that as Ugam mentioned, coinbase transactions are special, in that they do not consumer inputs)
Wouldn't that mean all of the transactions for a particular coin would have to be grouped in the same block?
When a UTXO is consumed as an input, those coins must be spent entirely, by the creation of new UTXOs as outputs. The sum of the outputs will be slightly less than the sum of the inputs (this difference will become part of the miner's fee for the block), so any excess of coins not specified in a new UTXO will simply be claimed as fees (added to the output of the coinbase transaction).
Everything I've seen on StackExchange about this refers to hashing in blocks, which makes sense to me on the level of blocks, but then I don't understand the level of hashing of transactions since it seems transactions are not organized into blocks by coin.
Right. A transaction is hashed to obtain the transaction ID (txID / wtxID), but this hash is not subject to the stipulations of being a valid proof-of-work.
There is one situation in which ordering within a block matters: suppose you create a transaction-1
that makes UTXO-1
, and then create a transaction-2
that spends UTXO-1
and creates UTXO-2
. If you wanted to include both of those transactions in the same block, then transaction-1
would need to be included before transaction-2
, otherwise transaction-2
would be seen as invalid (and thus the whole block would become invalid). In this way, 'child transactions' must always come after their parents, if included in the same block.
Otherwise, the transactions included in a block do not have to be related to each other at all, there is no requirement like this. The only stipulation is that a transaction must reference a valid UTXO (and hence the rule about ordering transactions that I mentioned above).