The inputs parameter tells Bazel what files to make available to the executable of the action when Bazel runs it. This parameter is important for a few reasons:
It tells Bazel what other actions need to be run to produce the input files for the given action. If you have Action1 <- Artifact <- Action2, where Action2 produces Artifact, and Action1 takes Artifact as an input, Bazel knows to run Action2 before Action1.
It tells Bazel what files to make available in the action sandbox. Otherwise the action won't be able to find any of its input files.
It tells Bazel what files to upload to remote execution workers, if remote execution is being used. Otherwise the file won't be available on the remote machine for the action to read.
The arguments parameter of ctx.actions.run tells Bazel what the command line for the executable of the action is. If your executable takes flags like --input and --output, you'd use arguments to construct a command line like --input artifact1 --input artifact2 --output artifact3.
See this example: https://github.com/bazelbuild/examples/blob/master/rules/actions_run/execute.bzl