Minecraft wiki entry for execute, associated text: Sets the execution position, rotation, and dimension to match those of an entity; does not change executor.
Syntax
at <targets> -> execute
Arguments
<targets>: entity
Target entity/entities to match position, rotation, and dimension with.
Must be a player name, a target selector or a UUID.
Result
Execution position, rotation, and dimension are updated to match target entity.
Unparseable if the argument is not specified correctly.
Terminates if <targets> fails to resolve to one or more valid entities (named players must be online).
When multiple entities are selected, next subcommand is executed once at each entity's execution position, rotation, and dimension.
Example
Move all sheep upward 1 block: execute as @e[type=sheep] at @s run tp ~ ~1 ~
Kill the player running the command, because "at" does not change the executor: execute at @e[type=sheep] run kill @s