It’s done off-chain because on-chain would be expensive and slow. On-chain takes 10 min and $1.50-$15 in fees depending on the day. Lightning takes < 1 second for < 1 penny in fees.
Lightning transactions are secured by the base chain, so you’re not at risk of losing any funds. The transaction data is “off-chain” because there’s no reason for it to be “on-chain”.