Javascript code inside “” in core WordPress files .php

These are Underscore Templates, handled by the wp.template() JavaScript function (source here) which takes in a template ID corresponding to a <script type="text/html" id="tmpl-{template ID}"> element containing such code and compiles it into a function. This function can then be executed with the variables used in the template in order to produce a string of HTML.

For the template in the excerpt provided in the question, that call might look like this:

const template = wp.template( 'attachment-details-two-column' );
const markup = template( {
  orientation: 'landscape',
  type: 'image',
  uploading: false,
  sizes: {
    large: {
      url: 'http://placehold.jp/3d4070/ffffff/150x150.png'
    }
  }
} );

Where markup would now be a string containing (in part):

    <div class="attachment-media-view landscape">
        <h2 class="screen-reader-text">Attachment Preview</h2>
        <div class="thumbnail thumbnail-image">
            <img class="details-image" src="http://placehold.jp/3d4070/ffffff/150x150.png" draggable="false" alt="" />

wp.template() configures Underscores to use <# #> delimiters instead of the standard <% %> in order to avoid conflicts with some environments, where PHP versions prior to 7.0 may have been configured with the now deprecated asp_tags directive.