How do I know what variables are passed in a filter/action and what their meaning is?

Basically every filter has to be registered in the original function code (since a filter is just a way you can overwrite what is happening in the default function). So before you can attach your custom function to a filter using add_filter() the filter has to be registered before with apply_filters() (there are other functions which do the same – but this is the most important one).

So in the example you have given in the original function there is a call to apply_filters() (line 533):

$output = apply_filters('bloginfo_url', $output, $show);

As you can see, the two parameters in the original function context are $output and $show.

So to sum up, the best way to find out what the parameters of a filter is:

  • Look up the documentation of the parameters in the codex (although not all filters are completely documented there).
  • Look at the sourcecode of the original function to see which parameters are passed to the filter.

Edit to answer your comment

Because $info is just another name for $output?

You are right. The names of the variables can change when they are passed through a filter. This is simply due to how declaring a function in PHP works:

my_function($output);

function my_function($info) {
    // in the context of this function the content of $output is now inside the variable $info.
}

Also what exactly happens in the filter named ‘bloginfo_url’? I tried
to find it in the core, but its not there.

By default nothing happens with bloginfo_url. WordPress Core doesn’t attach any functions to this filter. It just provides this filter for you, so you can change the native WordPress behaviour without needing to modify any of the core files. (This is only the case for this filter, some of the other filters are used by WordPress itself.)

One thing you always got to keep in mind when working with those filters is, that others (plugins or WordPress itself) can attach functions that conflict with things that you want to achieve with your function. You can control, when your function will run in regards to the other functions attached to the same filter with the $priority param.