Functions define the executable interface of a Solidity contract. They include parameters and optional return values, and they are annotated with: (1) visibility (who may call), (2) state mutability (view/pure/payable), and (3) optional modifiers and override behavior (in inheritance). These annotations influence both security reasoning and ABI encoding/decoding for external calls.
Visibility: public/private/internal/external