When you create a Style object, you set a bunch of Setter objects to it to define various properties to change the look and feel of the control. This may include the height, width, positions, alignments, colors, fonts, control template, triggers, and more.
The FrameworkElement class exposes a Style property that can be filled by a Style object. Styles are always built as resources, as you see them inside the <Window.Resources> tag in our example. It contains an x:Key property, which defines the name/key of the style. By using this Key, you can perform a binding from any other resources/controls within the scope. The TargetType property of a Style object is typically set, which makes the Style applicable to that type, which can be any type, even a type of a custom control.
In this example, the applied style works on Button objects. Trying to apply the same to some other element type will cause a runtime exception.