An output is locked by a rule
A transaction output carries a value and a scriptPubKey. A spending input identifies that exact output and supplies a scriptSig, witness, or both. Nodes retrieve the previous output and independently reject the spend if its rules fail.
A stack, not a general application
Opcodes push, compare, hash and verify data on a stack. Script has no general loops and cannot query a website, exchange price or private database, helping every node reach the same bounded, deterministic result.
Hashed and versioned conditions
P2SH commits to a redeemScript by hash; P2WSH and Taproot later introduced other ways to commit to conditions. A hash proves the revealed script matches the commitment, not that the policy is safe or recoverable.
Consensus differs from relay policy
Consensus rules decide what may enter a valid block. A node's standardness policy is a narrower local rule for its mempool and relay. Hand-written scripts can be valid yet difficult to propagate—or can permanently lock funds through a design error.