Scripts and shortcuts can drive a tmux pane too.
tmux send-keys -t work:1.0 'docker compose logs -f' Enter
-t work:1.0 means session work, window 1, pane 0. The final Enter is a key name, so the command actually runs.
Every tmux script builds on this. send-keys runs no command by itself. It types keys into a pane, so the pane has to be at a prompt that can accept them. Key names such as Enter, C-c and Up are written as words, and plain text goes in quotes.
You can also use it by hand. For example, restart a service in a pane where docker compose logs is running by sending C-c first and then the new command. I would keep it for small helper scripts, since a script that depends on the exact state of a pane is fragile.
tmux does not check what the pane is doing. If an editor has focus there, your text lands in the editor.
Try it without risk: start a throwaway session with tmux new -s scratch, use the shortcut or command above there, look at what changes, and close the session again with tmux kill-session -t scratch. Nothing else on your machine is touched.
Further reading: tmux manual page (OpenBSD, official), tmux wiki: Getting Started (official), On this site: Ctrl-b Alt-arrow resizes a tmux pane five cells at a time, On this site: setw synchronize-panes on types into every pane at once