View composers are used when the same data needs to be shared across multiple view files. Technically speaking, it can be dynamic or static data, however as far as I am aware, you cannot pass parameters to change the results, as these are setup in ServiceProviders.
For example (using this from a Laracasts video lesson): Imagine you have a navbar, and you want to show the title of the latest blog post.
The problem: In order for the navbar to receive the latest blog post, you would need to pass that blog post to every view that is rendered that includes the navbar, which in 99% of cases, would be every view. So for every method in your controller, you would do something like this:
// stuff that relates to this method
$latestPost = Post::latest()->first();
return view('my.view', compact('latestPost'));
Solution: Use a view composer to pass the $latestPost variable to the view that contains the navbar (e.g: app.blade.php or navbar.blade.php) so that the navbar has access to it