Normally a file should not contain metadata. As the prefix meta
indicates, metadata is beyond data. It belongs to a different realm
where you are concerned with characteristics of the file to know what
it is useful for, and that (usually) cannot be inferred with certainty
or easily enough from the content. Putting that information in the
file would interfere with the actual use of the file, as applications
would have to know about it. Furthermore, you may want to allow
different access regimes (use, modification) for the data and the
metadata.
Such considerations show that metadata concerning the file is to be
stored outside the file, though be associated with the file. Hence
metadata is often managed in a different memory location, though associated
with the file at OS level, either by the OS itself or by some
applications.
From an implementation point of view, metadata could be stored in the
file, if it is managed by the OS so that application receive a
stripped file (without metadata) when they are not supposed to be
metadata aware. This is also important when moving files to another
OS.
This said, metadata can be any information about the data, that helps
to better understand its relevance and usability for some purposes. It
can be very general, such as date or location of creation, ownership,
history, mutability, encoding standard, or very specific of some
applications such as artistic school or style, library classification,
keywords, etc.
In practice the kind of metadata available depends much on the
operating system, or on the file system (especially on removable
media). Some, such as access rights and date, may be found in the
directory structure. Some can be inferred from the file name suffix,
though this does not formally enforce its correctness. Some can be
managed by the storage location, for example some directories may
correspond to a specific role of files found in them. That is very
variable. There are also special tools to retrieve metadata, when it
is lost such as the file
command in Unix.
Some files corresponding to a specific encoding scheme, such as JPEG,
may contain in the file metadata that is meaningful for that encoding
scheme. That is not a problem, since the existence of this metadata
will be known to all applications accessing meaningfully the content
of the file.
As you see, metadata can be any information about the file,
whether technical or semantical. An it can be stored and associated
with the file in a wide variety of ways. Also. what is metadata for
one application may also be simply part of the file for other less
knowledgeable applications.
What can be done with or to metadata is also very variable.
The origin of the file, such as computer-name or user-name is not
standard on operating systems. But it does have owner, dates and access rights information, which may vary depending on operating systems and file systems.
The whole point of this is: to get a precise answer to your question,
you have to make it much more specific, and make more precise whether
you mean OS level, application level (which), encoding standard level,
etc.