The mark [security] means that the package comes from the security updates repository, rather than the main repository. The security updates repository is always enabled and you should never disable it. It contains packages that are identical to the original package from the main repository except that one or more security vulnerabilities have been fixed.
The same package is also provided in the <version>-updates repositories. These repositories contain bug fixes and other recommended updates. These updates are pushed in batches, unlike security updates which are released as soon as possible.
That the package imagemagick
is also provided by graphicsmagick-imagemagick-compat
is unrelated. Graphicsmagick is a software project that started as a modification of Imagemagick and then evolved independently. Graphicsmagick includes an interface that is compatible with Imagemagick; this interface is distributed in the package graphicsmagick-imagemagick-compat
. If you have graphicsmagick-imagemagick-compat
installed, then packages that depend on imagemagick
will work, therefore the graphicsmagick-imagemagick-compat
package declares that it provides imagemagick
. You can choose which implementation you prefer.
Ubuntu will automatically install the most recent version of a package among the repositories that are enabled on your system (except for versions or repositories that are excluded from automatic installations through preferences — for example, backport repositories are set up so that you only get backported packages upon explicit request).